minエラーについて。このプログラムで、 エラー: min データ型が無効です。​最初の引数は数値また​は論理値でなければな​りません。 このエラーが出ます。​どう解消すれば良いで​しょうか。

16 views (last 30 days)
亮太 渋谷
亮太 渋谷 on 15 Dec 2020
Commented: 亮太 渋谷 on 17 Dec 2020
x1 = A1(:,2);
y1 = A1(:,3);
z1 = A1(:,1);
xlin1=linspace(min(x1),max(x1),71);
ylin1=linspace(min(y1),max(y1),71);
[X1,Y1] = meshgrid(xlin1,ylin1);
Z1 = griddata(x1,y1,z1,X1,Y1,'v4');
surf(X1,Y1,Z1)
hold on
scatter3(x1,y1,z1,'ro')
xlabel('マーケティング効率性')
ylabel('生産調達効率性')
zlabel('ROE')

Answers (2)

michio
michio on 15 Dec 2020
どの行でのエラーかは分かりませんが、
x1 = A1(:,2);
whos x1
と x1 や y1 のデータ型を確認するとなにか分かるかもしれません。

亮太 渋谷
亮太 渋谷 on 16 Dec 2020
ありがとうございます。下のように表示されたのですが、これはどういうものなのでしょうか。
x1 = A1(:,2);
whos x1
Name Size Bytes Class Attributes
x1 76x1 1600 table
  3 Comments
michio
michio on 16 Dec 2020
A1 が table 型データなのが原因とみられます。
x1 = A1{:,2};
y1 = A1{:,3};
z1 = A1{:,1};
と table 型の変数から数値データだけを取り出すよう変更してみてください。
が参考になると思います。
亮太 渋谷
亮太 渋谷 on 17 Dec 2020
ありがとうございます!!
無事グラフが出ました!

Sign in to comment.

Categories

Find more on MATLAB in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

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

Start Hunting!