0

I have two 1-D cell arrays with numbers inside, how can I plot this?

X = {'1' '2' '35' }
Y = {'23' '30' '90' }

I am trying to plot the two cell arrays using plot command:

plot (X,Y);

And I received the following the error:

Not enough input arguments. 

Any suggestions?

1 Answer 1

4

You need to first convert your cell arrays of strings to an array of numbers. You can do this using str2double

X = {'1' '2' '35' }
Y = {'23' '30' '90' }

plot(str2double(X), str2double(Y))

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.