importing values to simulink!

  • Follow


Hi, 
I have a  designed a starter motor in simulink,
in which i need to give variable load torque as input.
for that i had created a excel with 75 input values.
I do not know how to give these values as input to the dc motor.
I had tried with constant, i had imported the excel to workspace.
but its taking all the 75 values at a time and showing error.
Instead I need it to take one value at a time and give result in the scope.
for each and every value i need to get a plot in the same scope.
0
Reply hari 11/29/2010 11:37:03 AM

"hari " <rhn.engg@lucastvs.co.in> wrote in message <id038v$dkk$1@fred.mathworks.com>...
> Hi, 
> I have a  designed a starter motor in simulink,
> in which i need to give variable load torque as input.
> for that i had created a excel with 75 input values.
> I do not know how to give these values as input to the dc motor.
> I had tried with constant, i had imported the excel to workspace.
> but its taking all the 75 values at a time and showing error.
> Instead I need it to take one value at a time and give result in the scope.
> for each and every value i need to get a plot in the same scope.

You need tu use the block "From Workspace" and define its input variable ( called simin by default).

One way to do it is to define a time vector, for example:
>>time=linspace(0,10,75)';  % a column of 75 time values linearly distributed between 0 and 10 seconds

Now your variable torque load. If you have it in Excel, import it to MATLAB, and make sure its size is 75 by 1. If you load variable is called "load", do:
>>size(load)
and make sure you get 

75   1
as an answer. If you get " 1 75", then transpose it by doing
>>load=load';

now create input matrix:
>>simin=[time load];
>>size(simin)  %check that you get 75 by 2
  
Your simulation should run now.
0
Reply Arkadiy 11/29/2010 4:03:05 PM



"hari " <rhn.engg@lucastvs.co.in> wrote in message 
news:id038v$dkk$1@fred.mathworks.com...
> Hi, I have a  designed a starter motor in simulink,
> in which i need to give variable load torque as input.
> for that i had created a excel with 75 input values.
> I do not know how to give these values as input to the dc motor.
> I had tried with constant, i had imported the excel to workspace.
> but its taking all the 75 values at a time and showing error.
> Instead I need it to take one value at a time and give result in the 
> scope.
> for each and every value i need to get a plot in the same scope.

Yes, a constant is a constant, not a signal that varies with time, therefore 
Simulink is treating your 75 values as a constant vector with 75 elements. 
You also need 75 values of time that correspond to your load torque input 
values. Once the data is imported in MATLAB, use the from workspace block 
and parameterize with the time and signal values, e.g. [time_values 
load_torque_values].

HTH,

Arnaud 

0
Reply Arnaud_Miege 11/30/2010 10:42:10 PM

"Arnaud_Miege" <amiege@mathworks.com> wrote in message <id3uk2$l81$1@fred.mathworks.com>...
> tks
0
Reply hari 12/6/2010 7:48:04 AM

3 Replies
412 Views

(page loaded in 0.002 seconds)

Similiar Articles:













7/19/2012 11:00:19 PM


Reply: