Matlab urgent help needed

Archived from the original Sajha.com — preserved as posted, replies can no longer be added here.
Start a New Discussion
Archived Post

Hi pals, I have spread sheet data for X, Y, U, and V, where X and Y represent position and U and V represent the corresponding horizontal and vertical velocity respectively. I have no knowledge on MATLAB however I have to use matlab to get the plot. I am expecting the codings for the plot. Related suggestions are highly welcome. I greatly appreciate your valuable inputs in this regards. foinme  

foinme · Sep 27, 2009 1:41 PM · 14,982 views

16 Replies

Usually if you go to help button on Matlab it will guide you to plot anything. You will learn to do it by yourself and its easy as well. Just you the help button.

nishedh · Sep 27, 2009 1:48 PM

Hi Nishedh, I have tried the help tool too. The example used is for a given function and in my case I have data set instead of function. I used the following coding but neither I got the arrowhead for the vectors nor did I see any slope of the vector lines. All I could get was series of vertical lines. X=data(:,1) Y=data(:,2) U=data(:,3) V=data(:,4) scale=0.2 figure(1) quiver(X,Y,U,V, scale) colormap hsv

foinme · Sep 27, 2009 1:59 PM

Is your data set in Excel or .csv format? There is a way to import the data into matlab if it's in Excel If not, you will have to list them in Matlab manually. What's the exact question? Reply fast and I can help you.

GuitarDaku · Sep 27, 2009 3:02 PM

Thanks Guitar Daku, My data is in notepad. I copied the data and pasted in m file. Then I used the above code for quiver plot. 1.  I could not see the arrow 2. Since value of U and V is provided for every location, I was expecting to see the slope of vector , but I could not see that 3. I can see only vertical lines in the plot. If you provide me your email, I will attach the m file with data on it. foinme

foinme · Sep 27, 2009 3:08 PM

Email me at passinthru05 aT hot mail

GuitarDaku · Sep 27, 2009 3:16 PM

I have attached the m file in the above email address. foinme

foinme · Sep 27, 2009 3:28 PM

I don't see it. it's passinthru then zero 5 btw.

GuitarDaku · Sep 27, 2009 4:59 PM

nvm, i see it. it went in junk for some reason.

GuitarDaku · Sep 27, 2009 5:00 PM

Got yr m file. What is the last column for? The one ending with 0.310085E+02  . That column has not been used. Shouldn't there be just 4 columns? Or am I missing something?

GuitarDaku · Sep 27, 2009 5:29 PM

The last two columns are of no use in our case. I put the result obtained from my result and copied on m file. Only the first four columns are of use in our case.     foinme

foinme · Sep 27, 2009 7:51 PM

Hi guitar daku, The first and second columns represents position (x,y) and the third and the fourth column represents velocity (u,v). Rest of the columns, we don't need in this case foinme

foinme · Sep 28, 2009 10:41 AM

PLEASE ................,  ITS URGENT.

foinme · Sep 28, 2009 1:46 PM

Sorry but can't solve it. Data has been input correctly; play around with the syntax more. I can't figure it out though. Good luck.

GuitarDaku · Sep 28, 2009 6:25 PM

Hey Are the columns of data in your m file? If so, are they all numbers? Make sure the headers are removed. And are you doing a 3-d plot? Anywhow, So X and U are one pair and Y and V are another pair? If you wanna gt data from a m file, you need to use dlmread Using dlmread, you can convert the string of numbers in any m file into numbers [integers, reals, etc] I'm not sure how you want this thing t be plotted. Are you looking for two diffrent plots? One for (X,U) and another for (Y,V)? Or is it all going to be in one plot? If so,l why are there two columns? Need more info because this is a piece of cake.

nepaligundo · Sep 28, 2009 9:28 PM

Thanks Nishedh, Guitar daku and Nepali Gundo, I got the the vector plot.  However there is one problem. The length of line gives the magnitude and the arrow direction gives the direction. In my case the arrow head is so long that the length of line is almost invisible. Is there any way to minimize the length of arrow head obtained from quiver plot? foinme

foinme · Sep 29, 2009 9:25 AM

One thing you can do is to set the x and y axis maximum and minimum. look up "set gca" in matlab help axis([xmin xmax ymin ymax]) Look up axis in matlab help. And see what those xmin xmax, etc mean. That should help you.

nepaligundo · Oct 3, 2009 10:04 AM

This conversation is preserved exactly as it was on the original Sajha.com and can't accept new replies.

Start a New Discussion

You might be interested in...

Recent Classifieds View all
Upcoming Events View all
Service Providers View all