Open ethangoldstein opened 3 years ago
I got the same error. Attached is an example file that comes with LTspiceXVII that can reproduce this error.
C:\Program Files\LTspiceXVII\examples\Educational\FRA\Eg1.asc Run simulation -> Eg1.raw
".tran 0 {5/Freq+.1m} .1m" in Eg1.asc can save computation burden significently, but it cause the simulation data points (and also the matrix size) vary depends the variable {Freq} along each step.
(line 531) "mat_size(2) / num_steps" is not compatible with this situation and causes the error.
I would appreciate taking consider this situation. Thank you.
YC Niu Eg1.zip
@ethangoldstein @yc-niu
I also had this problem recently, but finally solved it perfectly.
I guess the reason is because the length of the data is inconsistent, since LTSpice is a solver with variable step size.
The solution is to use the software "ltsputil.exe" to interpolate the data in the raw file to achieve a consistent step size. For the new version of LTSpice, you also need to use "ltsputil17raw4.exe" to convert raw files.
The above software can be easily found in google. Below is the code I use, just for reference:
cd/d D:\Circuit_results\sweep_new\verify ltsputil17raw4.exe fixed_frequency.raw converted_fixed_frequency.raw ltsputil.exe -eo converted_fixed_frequency.raw output_fixed_frequency.raw 40000
Note that they should run by CMD command, or use the batch file.
One more important step is to keep raw uncompressed, the following command can be used in LTSpice.
.opt plotwinsize=0
But this will greatly increase the raw file size.
Hello,
I am able to load the .raw file when I run a basic .tran command. However, when I include a .step directive in the simulation I get the following error from MATLAB:
Any help would be greatley appreciated.
Thank You,
Ethan