From: Walter Roberson on
UrbGru Grundström wrote:
> I have a question if it's possible to make a specific code shorter, i.e
> I'm looking for a way to simplify the code.
>
> Now the code looks like this:
>
>
> load splitmu_no_steerback_mna50kph_1_200kpa
> Test_Plot_SteerAngle_Speed
> plot (sync_Var_SA(:,1), sync_Var_SA(:,2))
> hold on
> plot (sync_Var_VS(:,1), sync_Var_VS(:,2))


plotColors = 'brgy';
datafiles = {'splitmu_no_steerback_mna50kph_1_200kpa.mat', ...
'splitmu_no_steerback_mna50kph_2_200kpa.mat', ...
'splitmu_nosteerback_mna50kph_1_igen.mat', ...
'splitmu_nosteerback_ugr50kph_1_200kpa.mat' };

for K = 1 : length(datafiles)
load(datafiles{K});
Test_Plot_SteerAngle_Speed
plot (sync_Var_SA(:,1), sync_Var_SA(:,2))
hold on
plot (sync_Var_VS(:,1), sync_Var_VS(:,2))
end

From: ImageAnalyst on
On May 26, 10:17 am, "Steven Lord" <sl...(a)mathworks.com> wrote:
> I just clarified that section of that FAQ entry.
> Steve Lord
> sl...(a)mathworks.com
> comp.soft-sys.matlab (CSSM) FAQ:http://matlabwiki.mathworks.com/MATLAB_FAQ
-----------------------------------------------------------------------------------------------------------------------------------
Good work Steve. It's much much better than it used to be. You give
three different ways to construct the filename, have nice descriptive
variable names, and show two different ways of getting the list of
names (sequential and using dir()). Nice improvement.

Feel free to clarify any other parts. ;-)
Or add any sections, such as the ever popular "How do I save my
figure? Using (hgsave/saveas/print/ etc.) doesn't save an image that
looks like how it looks on my screen. It's a different size (or not
the size I want), has different colors, has huge blank space padding,
etc."
From: us on
"UrbGru " <ubbe1000(a)hotmail.com> wrote in message <htj8ha$qgl$1(a)fred.mathworks.com>...
> Well, I guess that didn't help me in my problem...
>
> The files can't have the same name and just be sequentially numbered.
>
> And the second part that said: "If instead you want to process all the files whose name matches a pattern in a directory, you can use DIR to select the files:"
>
> But it uses the command "imread" which works just for pictures, right?

well, guess what: this is JUST AN EXAMPLE...
use whatever function needs your file name(s)...

us