Why can't i use "from file" block in simulink
Ältere Kommentare anzeigen
i have a .mat file that i want to use in simulink using "from file" block
i put a "from file" and "scope" blocks into simulink and then connect them with each other.
i configured sample time in from file block as 1 that is equal to same sample time in .mat file and used fixed step ode3 solver with auto fixed-step size.
when i run, matlab gives no error, but i see this http://s7.postimage.org/y8ue6cmwr/matlab.png when i open scope
Antworten (2)
Azzi Abdelmalek
am 30 Nov. 2012
Bearbeitet: Azzi Abdelmalek
am 30 Nov. 2012
The problem is how you saved your data. Example
t=0:0.1:10; % vector time
y=sin(t) % t and y are line vectors
ty=[t;y] % ty should be a matrix with 2 rows
save filename ty
Now you can use your file in your simulink model. I think that you saved ty with two columns instead of 2 rows,
1 Kommentar
satish kumar
am 11 Aug. 2020
Hello, i tried to load the data: t=[45, 67,8.9,6.7,5.5,3.2,5.6,7.9] into simulink using " from file " block in simulink. t is saved as .mat file. t is generated from matlab code. I am facing problem in loading all the points in simulink. the first data point in t, i.e. t(1)=45 is not loaded in simulink. others have been successfully loaded. Please help how to load data in array form like this without missing first point. kindly help.
Kategorien
Mehr zu General Applications finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!