Matlab help

Posted by Michael.

I figure I’ll try this resource, too.

what I have: a data file with three columns: frequency, temperature, and “eta”. I want to make a 2D plot of eta vs frequency and temperature, like this:

etafth_vs_ttb-and-wfwb.

What I have done is to write a code that reads the file and stores the third colum, the eta values, in a 2-D array – so for example, data[12,8]=0.8713. However, I now need to re-scale the axes so that they read from 0.1 to 1 or from 1 to 8 instead of just using the x/y indices (1 to 80, etc). Do people know how to do that? or, maybe instead I should do a scatterplot of z at location [x,y] instead of the surfc command that produced the above image?

thanks.

  

3 Responses to “Matlab help”

  1. Nathaniel Says:

    This is EXACTLY the problem that I had last year plotting some results for my thesis. I ended up talking to a woman over in the library about how to make the plot in openDX. Susan Schwartz. It’s her job to help people with technology issues in their research.

    However, it might be easier just to use the tool you already have. Have you tried using awk to just change the values of your x and y indices? Something like

    awk ‘{print $1/10., $2/10., $3}’ originalfile > newfile should do the trick

    There might be some tricks to making sure that the indices are written as floats instead of integers, but it might work really easily.

  2. Tim Says:

    Yeah, sorry to be slow on this.

    Does it have to be in the MatLab? ‘Cause I think Igor does plots like that without much finagle-ing.

    I’m pretty sure we do a similar thing with some of our stability diagram plots…

    You and should talk about this more in person…

  3. Michael Says:

    Good call with Igor, I hadn’t thought to try a two-D plot but I’ll give it a shot – I’ve just been using Matlab b/c of all the other code/data manip stuff.

Leave a Reply