×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

General Matlab question

General Matlab question

General Matlab question

(OP)
Hi,

I'm curious if there is a way to save(export) a figure as a jpg file using only the commandline. In other word, I want to embedded the graph production in a m-script so that I don't have to click through several menus.

Also, I'm wondering if there is a way to access an array element of an output directly. Let say I have type

size(matrix)

and the return value is [1 2 3]. Is there a direct way to access the first element(1)? Currently, I have to assign the output to a, then call a(1). Would be nice to eliminate this temp variable.


Thanks!

RE: General Matlab question

you can use "saveas" command in matlab.

for example if you want to save an x-y plot,

h=plot(x,y);             
saveas(h,'filename.jpg');

nodal..

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources