|
"Amish Rughoonundon" <amishspam@yahoo.com> wrote in message <h5eln5$l1g$1@fred.mathworks.com>...
> I have the following function:
> <CODE>
> function [voltage_csv_data, current_csv_data] = runEventDesign()
> % Switch to project directory
> cd 'C:\Documents and Settings\RughooAm\My Documents\MATLAB\Ray_event_classification'
>
> % Get the simulation data from the csv file
> [voltage_csv_data, current_csv_data] = captureCsv('2009130', 35, 8180);
>
> % Simulate the simulink project
> sim ray_event_classification_test.mdl;
> </CODE>
>
> It seems that [voltage_csv_data, current_csv_data] does not get transfered to the main workspace until this function exits. The problem is that the simulink simulation needs to have the voltage and current data in the main workspace before it can execute. Is there any way to force the code to return the values to the main worspace before the simulink simulation code line.
> Thanks for the help,
> Amish
% I'm not sure, but perhaps:
doc assignin
% will help.
% Also, shouldn't your above code be either:
cd C:\Documents and Settings\...\Ray_event_classification
% or
cd ('C:\Documents and Settings\...\Ray_event_classification')
% If you want your code to be transportable,
% you should look into:
doc fullfile
doc fileparts
|