フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Hello I was trying to plot using the following code but i get this error. Can someone help me please? Thank You

1 回表示 (過去 30 日間)
Abdollah Sedaghat
Abdollah Sedaghat 2018 年 8 月 26 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
clc;
clear;
close all;
qc=pi/.15;
delta=0.01;
[X,Y] = meshgrid(0:0.1:1,0:0.1:1);
for alpha=[0.3,0.5,0.7]
for(i=1:11)
syms q ;
A=(q^2*coth(q))/(((1+q^2*(X(i))^2/(2*alpha)))^(1+alpha));
B=(q^2*coth(q))/(((1+q^2*(Y(i))^2/(2*alpha)))^(1+alpha));
ASK1=int(A,0,qc);
ASK2=int(B,0,qc);
Z(i)=(1+(delta)^2*X(i)^2*ASK1)+((delta)^2*Y(i)^2*ASK2);
end
hold on;
surf(X,Y,Z)
end
z must be a matrix not a scalar or vector
  1 件のコメント
Rik
Rik 2018 年 8 月 26 日
The error is self-explanatory: the surf function requires a matrix as a third input, not a symbolic vector. Also, your Z vector has only 11 elements, while the grid you're trying to plot to is 11 by 11.

回答 (0 件)

この質問は閉じられています。

タグ

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by