Print Function - Error
15 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello,
I've posted to this forum previously; I've inherited an old .m file (10 year old code) for vehicle dynamics that I'm trying to make more robust and efficient. I'm receiving tons of errors, but I'm slowly sorting through them.
This error involves a print function that prints each figure (a total of 12 figs) and creates a .ps file and a summary text file. I've tried debugging the error, but I'm not able to fix it.
Here is the code that follows each plot:
if 1i==1,
eval(['print -dpsc ' prfile]);
else
% eval(['print -dpsc -append ' prfile]);
end
Here is the error:
??? Error using ==> inputcheck at
34
Multiple inputs that look like
filenames: 'C:
Error in ==> print at 163
[pj, devices, options ] =
inputcheck( pj, inputargs{:} );
Error in ==> OC_N1_rev1 at 520
eval(['print -dps -append '
prfile]);
I can paste more code if you need it to dissect the problem further.
If there is code to bypass the .ps file and go to .pdf that would be much better. Again, I'm not very strong on the programming side of matlab.
Thanks for you help!
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 2 Jun. 2011
Convert to this:
if 1i==1,
print('-dpsc',prfile);
else
% print('-dpsc', '-append', prfile);
end
Your difficulty is that before the code was not expected to work with directories or files that had spaces in the name, and now you expect it to do that. The altered code will work with either kind of name.
0 Kommentare
Weitere Antworten (2)
Nirmal Gunaseelan
am 2 Jun. 2011
The error message seems to suggest that the file name is incomplete.
??? Error using ==> inputcheck at
34
Multiple inputs that look like
filenames: 'C:
So in your code does prfile contain the path to the file name? Maybe you are missing a ' ' to make sure it has the entire individual path?
0 Kommentare
Fangjun Jiang
am 2 Jun. 2011
You may be able to create a .pdf file directly from print() function depending on your Matlab version. Check your document:
doc print
0 Kommentare
Siehe auch
Kategorien
Mehr zu Variables finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!