Plotting two matrix error

Hello, I'm trying to get graph for two matrix versus each other each is 8000*1 matrix,and I tried plotmatrix too but I get this error : Error using plot Not enough input arguments.
close all
clear all
clc
%by
a=importdata('945bluesteel1018.txt');
b=a.textdata(66:8065,2)
c=a.textdata(66:8065,3)
plot(b,c)
Thanks for your help

7 comentarios

Azzi Abdelmalek
Azzi Abdelmalek el 6 de Sept. de 2013
Type
whos b c
What did you get?
Salar
Salar el 6 de Sept. de 2013
they are each 8000 by 1 matrices
Walter Roberson
Walter Roberson el 6 de Sept. de 2013
Please use
which -all plot
to check to be sure you do not have some other plot function in your path.
Salar
Salar el 6 de Sept. de 2013
thanks for prompt response, we check we do not have any other plots, we both doing this and we both getting the same error
Salar
Salar el 6 de Sept. de 2013
it gave us : built-in (C:\Program Files\MATLAB\R2011b\toolbox\matlab\graph2d\plot)
Walter Roberson
Walter Roberson el 6 de Sept. de 2013
Could you put a breakpoint in at the plot statement and run and check the size and class of b and c ? Are they cell arrays perhsp?
the cyclist
the cyclist el 6 de Sept. de 2013
If you put in a breakpoint, be sure to remove your
clear all
command, which I believe will clear the breakpoint before you can stop at it.

Iniciar sesión para comentar.

Respuestas (1)

Image Analyst
Image Analyst el 6 de Sept. de 2013

0 votos

This works for me:
a=sort(rand(8065, 3)); % Sample data.
b=a(66:8065,2);
c=a(66:8065,3);
whos ('a', 'b', 'c')
plot(b, c);
You must be doing something you aren't showing us, other than the exact error message (everything in red) which, for some reason, you chose not to share with us.

2 comentarios

Salar
Salar el 14 de Sept. de 2013
Hello, thanks for the prompt response, I can assure you that there is nothing else that I'm hiding or something, but there is something that we think it has to do with this error maybe you can help us. we call b=a(66:8065,2) and when I go to look at the matrix b , I see commas after each element. it looks like that it picks up these commas from the text file, can that cause this error? if yes, how do we get rid of these commas? Thanks
Salar
Salar el 14 de Sept. de 2013
Thanks for everyone's help, I already got the answer,

Iniciar sesión para comentar.

Categorías

Preguntada:

el 6 de Sept. de 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by