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

20 vues (au cours des 30 derniers jours)
亮太 渋谷
亮太 渋谷 le 15 Déc 2020
Commenté : 亮太 渋谷 le 17 Déc 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')

Réponses (2)

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

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

Connectez-vous pour commenter.

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!