<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<font face="Courier New, Courier, monospace">Dear all,<br>
<br>
I know it is better to use plot2d, but I wonder why plot works
differently from plot2d when one of the variables is integer.<br>
<br>
Consider this code<br>
<br>
// Generate x axis with real (double) numbers<br>
x = (1:20)/20<br>
<br>
// Generate y axis with random integers<br>
y = iconvert(100*rand(1,20),2)<br>
<br>
// Plot y vs x<br>
plot(x, y)<br>
<br>
The plot represents x vs its index, which is not the intended
behavior. Replacing plot(x,y) with plot2d(x,y) we get the correct
plot.<br>
<br>
The documentation of both plot and plot2d requires "real" matrix
or vector. It seems that plot takes it a bit too literally (as a
data type) while plot2d adheres to the mathematical meaning of
"real" (considering integer numbers as a subset of real numbers).<br>
<br>
Is there a fundamental reason for this?<br>
<br>
The problem arises when one retrieves integers from a file without
converting them to double (which requires much more memory).<br>
<br>
Regards,<br>
<br>
Federico Miyara<br>
<br>
</font>
<div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br /> <table style="border-top: 1px solid #D3D4DE;">
<tr>
<td style="width: 55px; padding-top: 18px;"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank"><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" width="46" height="29" style="width: 46px; height: 29px;" /></a></td>
<td style="width: 470px; padding-top: 17px; color: #41424e; font-size: 13px; font-family: Arial, Helvetica, sans-serif; line-height: 18px;">Libre de virus. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank" style="color: #4453ea;">www.avast.com</a> </td>
</tr>
</table>
<a href="#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"> </a></div></body>
</html>