Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
Hello I was trying to plot using the following code but i get this error. Can someone help me please? Thank You
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentario
Rik
el 26 de Ag. de 2018
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.
Respuestas (0)
La pregunta está cerrada.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!