On Nov 25, 2015 3:18 PM, "Jonathan Camilleri" <[hidden email]> wrote:

>

> Will check my math, meanwhile I cannot get a graph running, I think the data is somehow making Octave think too hard.

>

> Attr Name Size Bytes Class

> ==== ==== ==== ===== =====

> iris_data 150x4 4800 double

>

> Total is 600 elements using 4800 bytes

>

> >> scatter(iris_data, iris_data, [], sqrt (x.^2 + y.^2)

>

> ....

> Waits for longer than 1 minute and does not display a scatterplot.

>

>

>

> On 25 November 2015 at 19:46, Nicholas Jankowski <[hidden email]> wrote:

>>

>> On Wed, Nov 25, 2015 at 1:09 PM, Jonathan Camilleri <[hidden email]> wrote:

>>>

>>> Can anyone help me figure out what is wrong here, I am trying to use a matrix which is 150x4, and, I do not understand the validation, unfortunately.

>>>

>>> The errors are not very clear.

>>>

>>> scatter(iris_data, min(iris_data), 'o')

>>> error: __scatter__: mx_el_or: nonconformant arguments (op1 is 600x1, op2 is 4x1)

>>> error: called from

>>> __scatter__ at line 52 column 7

>>> scatter at line 86 column 10

>>>

>>> Regards,

>>>

>>>

>>

>> I'm assuming iris_data is loaded directly from the csv file you attached. the scatter function is confused about your two input vectors and how to use them to make x,y pairs for plotting.

>>

>> what it's saying is that your two input vectors (or matrices) are not the same size ("nonconformant arguments"). it wants scatter(x,y), and you've given more x's than y's. if it sees a matrix, it internally looks at it as a vector (stacking your four columns to give a 600x1 array), and expects it to pair up element-by-element with the other matrix or vector.

>>

>> You should look at your second input, min(iris_data), at the command line to visualize the problem. on a vector, min() returns the min. from help min: "For a vector argument, return the minimum value. For a matrix argument, return a row vector with the minimum value of each column. For a multi-dimensional array, `min' operates along the first non-singleton dimension."

>>

>> so, for you min(iris_data) returns a 1x4 array. you're now passing a 150x4 array and a 1x4 array into scatter(). Octave has no idea what to do with that. I don't know what you were trying to do by pulling out the minimum of the data, but if you wanted a single value, you'd need 'min(min(iris_data))'. that would still fail, however, as you'd be passing a 150x4 and a scalar, and Octave would still be confused.

>>

>> What are you trying to plot here?

>>

>> Nick J.

>

>

Please get in the habit of using Reply All to keep the mailing list in the discussion. That's easy enough to do in gmail. So is replying at the end by clicking those 3 little dots Gmail uses to hide the copied reply in the text box for the email.

You're plotting that irisdata against itself. The first two scatter inputs are the x-values and y-values. You've put iris data in for both. Plotting that would put them in a straight line with a slope of 1.

Best as I can tell, you've passed an empty matrix to skip the 'marker size' option called 's' in the help, and the x^2+y^2 is probably just confusing the graphics program since the 4th input is where you'd specify color. You also haven't defined x or y it seems, so don't know what you are trying to do with those undefined variables.

_______________________________________________

Help-octave mailing list

[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave