Aug 17, 2006 #1 Luckybuilding Member level 1 Joined Oct 8, 2005 Messages 40 Helped 2 Reputation 4 Reaction score 1 Trophy points 1,288 Activity points 1,615 Hi, all I have problem on using "From Workspace" Block of Matlab simulink. When I use it in a model file. it gives me error. I want to import an array of signal data ( in time domain) to a model. Can anyone help me using this block of simulink? Please, give me a sample model using this block if it is possible. Thanks
Hi, all I have problem on using "From Workspace" Block of Matlab simulink. When I use it in a model file. it gives me error. I want to import an array of signal data ( in time domain) to a model. Can anyone help me using this block of simulink? Please, give me a sample model using this block if it is possible. Thanks
Sep 21, 2006 #2 N nafraf Member level 5 Joined May 2, 2002 Messages 86 Helped 6 Reputation 12 Reaction score 3 Trophy points 1,288 Activity points 490 Re: How to use "From Workspace Block" in Simulink? Hi, you should create a structure or a matrix following the format that the block needs. The format required for a matrix is var = [TimeValues DataValues], a simple code to implement this in matlab script is: time = 1:0.1:2*pi; data = sin(time); VAR = [time; data]' After that, you set the parameter 'Data' of the "From Workspace" equals to VAR. Similar procedure can be done to create a structure.
Re: How to use "From Workspace Block" in Simulink? Hi, you should create a structure or a matrix following the format that the block needs. The format required for a matrix is var = [TimeValues DataValues], a simple code to implement this in matlab script is: time = 1:0.1:2*pi; data = sin(time); VAR = [time; data]' After that, you set the parameter 'Data' of the "From Workspace" equals to VAR. Similar procedure can be done to create a structure.
Sep 21, 2006 #3 Luckybuilding Member level 1 Joined Oct 8, 2005 Messages 40 Helped 2 Reputation 4 Reaction score 1 Trophy points 1,288 Activity points 1,615 worked well. thanks very much. should I change time settings of the model file or not??
Oct 5, 2006 #4 N nafraf Member level 5 Joined May 2, 2002 Messages 86 Helped 6 Reputation 12 Reaction score 3 Trophy points 1,288 Activity points 490 Re: How to use "From Workspace Block" in Simulink? Hi, The sample time of the block should be the same time used in the data input, 0.1 in the previous example (time = 1:0.1:2*pi The time configuration for the simulation could be changed too, but generally I setup it as "auto".
Re: How to use "From Workspace Block" in Simulink? Hi, The sample time of the block should be the same time used in the data input, 0.1 in the previous example (time = 1:0.1:2*pi The time configuration for the simulation could be changed too, but generally I setup it as "auto".