function [ret]=fgsolve(); % %QucsStudio_v3.3.2 fg solver % %Based on the diode example in the Tutorial "Simulation_Optimization" % % @(#) fgsolve.m 1.0 (C) Z. Huszka 26-July-2021 % infile=fullfile('"C:\Documents and Settings\zhu\qucs3"','netlist.txt'); %outfile=fullfile('"C:\Documents and Settings\zhu\qucs3\model_prj"','model.dat'); %outfile=fullfile('C:\Documents and Settings\zhu\qucs3\model_prj','model.dat'); outfile='model.dat'; qs_bin=getenv('qucs3_bin'); %environmental variable qsfun=fullfile(qs_bin,'qucssim.exe'); %call Qucssim simulator dostxt=[qsfun,' -a ',infile,' ',outfile, ' >nul']; dos(dostxt); %read and return results Vd=loadQucsVariable(outfile,'Vd'); Id=loadQucsVariable(outfile,'Id.I'); ret=[Vd,Id], return