From: tuli on
Sounds elementary but I did not yet figure it out:

x0=Currents(:,1);
y0=Currents(:,2);
z0=Currents(:,3);
Jx=Currents(:,4)+i*Currents(:,5);
Jy=Currents(:,6)+i*Currents(:,7);
Jz=Currents(:,8)+i*Currents(:,9);
Jx_Mag=20*log(max(abs(Jx),10^(-60)));
SURF(x0,y0,z0,Jx_Mag);

I Get "Z must be a matrix, not a scalar or vector."

Then I do

Jx_Mag_Matrix=[x0 y0 z0 Jx_Mag];
SURF(x0,y0,z0,Jx_Mag_Matrix);

And I get "Z must be a matrix, not a scalar or vector".

I understand I have a problem with Jx_Mag, but I don’t know how to fix
it.

Please advise

Thanks
From: us on
tuli <tuli.herscovici(a)gmail.com> wrote in message <fa8bc39b-592a-40c6-a371-47d373e6cd99(a)e15g2000yqo.googlegroups.com>...
> Sounds elementary but I did not yet figure it out:
>
> x0=Currents(:,1);
> y0=Currents(:,2);
> z0=Currents(:,3);
> Jx=Currents(:,4)+i*Currents(:,5);
> Jy=Currents(:,6)+i*Currents(:,7);
> Jz=Currents(:,8)+i*Currents(:,9);
> Jx_Mag=20*log(max(abs(Jx),10^(-60)));
> SURF(x0,y0,z0,Jx_Mag);
>
> I Get "Z must be a matrix, not a scalar or vector."
>
> Then I do
>
> Jx_Mag_Matrix=[x0 y0 z0 Jx_Mag];
> SURF(x0,y0,z0,Jx_Mag_Matrix);
>
> And I get "Z must be a matrix, not a scalar or vector".
>
> I understand I have a problem with Jx_Mag, but I don&#8217;t know how to fix
> it.
>
> Please advise
>
> Thanks

no... you have a problem with your syntax...
most carefully look at the syntax of your call to SURF, again...

us
 | 
Pages: 1
Prev: how to do this
Next: ODE: events skipped