Hello everyone,
I'm trying to plot a surface with the following code, but I keep getting this error. I don't know how to solve this, could someone help me?
Thanks in advance.
clear all;% Welding parameters
%----------------------------
U = 28; %Voltage (V)
I = 260; %Current (A)
n = 0.9; %Efficiency
Q = U*I*n; % Goldak Double-ellipsoid
%------------------------
a = 5; b = 6; C1 = 5; C2 = 20;FF = 0.6;FR = 1.4;x = [-10:.2:10];y= 0;for z = -15:.05:15 if z < 0 C = C1; F = FF; else C = C2; F = FR; endend[xx,zz] = meshgrid(x,z);A = ((6*sqrt(3)*F*Q)/(a*b*C*pi*sqrt(pi)));B = exp(-3*(xx.^2/a.^2)).*exp(-3*(zz.^2/C.^2));q = A*B;surf (xx,zz,q)Error using surf (line 57)Z must be a matrix, not a scalar or vector.Error in Goldak2 (line 34)surf (xx,zz,q)
Best Answer