thliebig / openEMS

openEMS is a free and open-source electromagnetic field solver using the EC-FDTD method.
http://openEMS.de
GNU General Public License v3.0
448 stars 152 forks source link

plotRefl.m not Matlab compatible? #74

Closed srcejon closed 1 year ago

srcejon commented 3 years ago

openEMS 64-bit v0.0.35 on Windows 10 with Matlab R2020b

Trying to run the patch antenna example (first time user). It fails with:

Error: File: plotRefl.m Line: 120 Column: 19 Indexing with parentheses '()' must appear as the last operation of a valid indexing expression.

Which corresponds to the following line:

llegend = num2str(port.f(lowerind)(1)/1e6, ffmt);

(And there are a few other lines in that file with similar syntax - the Matlab editor says Cannot call or index into a temporary array)

I think this syntax for cascaded indexing is only supported in Octave, not Matlab.

If I use temp variables to work around it, I then get:

Error using linspace (line 22) Inputs must be scalars.

Which is from:

linspace(-ImZ, ImZ, 256)

Where ImZ = 0.0000 + 1.0000i 0.0000 + 2.0000i 0.0000 + 5.0000i 0.0000 + 2.0000i

Again, looks like this is something supported by Octave, but not Matlab.

thliebig commented 3 years ago

That might very well be the case. I do not have Matlab available. Maybe you can find a solution that works for Matlab and hopefully we can find something that works for both