thanks for the reply...here is a more expanded example of combining scripts. I have two scripts named chart1.m and chart2.m as follows:
%chart1
x = 0:.2:20;
y = sin(x)./sqrt(x+1);
y(2,:) = sin(x/2)./sqrt(x+1);
y(3,:) = sin(x/3)./sqrt(x+1);
plot(x,y)
and chart2:
%chart2
x = -pi:.1:pi;
y = sin(x);
plot(x,y)
I try to run these two codes one after another and have their output recorded on one chart:
%combined charts
figure(1);hold on;
chart1.m
chart2.m
and still I get the followign error:
Warning: Direct access of structure fields returned by a function call (e.g.,
call to chart1) is not allowed. See MATLAB 7.10 Release Notes, "Subscripting Into Function Return Values" for details.
> In combinedcharts at 2
??? Attempt to reference field of non-structure array.
Error in ==> combinedcharts at 2
chart1.m
I wonder what do you think is causing this error?
Thanks!