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

18 visualizaciones (últimos 30 días)
亮太 渋谷
亮太 渋谷 el 15 de Dic. de 2020
Comentada: 亮太 渋谷 el 17 de Dic. de 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')

Respuestas (2)

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

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

Iniciar sesión para comentar.

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!