Error using plot; invalid first data argument

%this is my code. it is returning the titular error and I cannot figure out why
data=load('riverspeed.html')
x=data(1,:)
y=data(2,:)
color=input('select color')
symbol=menu('Select symbol','point','circle')
switch symbol
case 1
plot(x,y,color,'.')
case 2
plot(x,y,color, 'o')
end
%'riverspeed.html' is a random two row matrix

 採用された回答

KSSV
KSSV 2017 年 1 月 25 日

0 投票

data=load('riverspeed.html')
x=data(1,:) ;
y=data(2,:) ;
color=input('select color:')
symbol=menu('Select symbol:','point','circle')
switch symbol
case 1
plot(x,y,strcat(color,'.'))
case 2
plot(x,y,strcat(color,'o'))
end

1 件のコメント

Alex Hosmer
Alex Hosmer 2017 年 1 月 25 日
that worked perfectly thank you

サインインしてコメントする。

その他の回答 (1 件)

Jan
Jan 2017 年 1 月 25 日

0 投票

Then please explain the type and contents of this first argument.
data = load('riverspeed.html');
x = data(1,:);
class(x)
size(x)
x
What do you get? I guess load('*.html') does not do, what you expect, because load is not designed for HTML files.

カテゴリ

ヘルプ センター および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

質問済み:

2017 年 1 月 25 日

コメント済み:

2017 年 1 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by