[Show all top banners]

foinme
Replies to this thread:

More by foinme
What people are reading
Subscribers
:: Subscribe
Back to: Computer/IT Refresh page to view new replies
 Matlab urgent help needed
[VIEWED 6384 TIMES]
SAVE! for ease of future access.
Posted on 09-27-09 1:41 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

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
 

 
Posted on 09-27-09 1:48 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

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.

 
Posted on 09-27-09 1:59 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

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

 
Posted on 09-27-09 3:02 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

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.

 
Posted on 09-27-09 3:08 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

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


 
Posted on 09-27-09 3:16 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Email me at passinthru05 aT hot mail


 
Posted on 09-27-09 3:28 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

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

foinme

 
Posted on 09-27-09 4:59 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

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

 
Posted on 09-27-09 5:00 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

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

 
Posted on 09-27-09 5:29 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

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?

 
Posted on 09-27-09 7:51 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

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


 
Posted on 09-28-09 10:41 AM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

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

 
Posted on 09-28-09 1:46 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

PLEASE ................, 

ITS URGENT.

 
Posted on 09-28-09 6:25 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

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.
 
Posted on 09-28-09 9:28 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

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.

 
Posted on 09-29-09 9:25 AM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

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

 
Posted on 10-03-09 10:04 AM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

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.

 


Please Log in! to be able to reply! If you don't have a login, please register here.

YOU CAN ALSO



IN ORDER TO POST!




Within last 7 days
Recommended Popular Threads Controvertial Threads
TPS Re-registration case still pending ..
and it begins - on Day 1 Trump will begin operations to deport millions of undocumented immigrants
Travel Document for TPS (approved)
All the Qatar ailines from Nepal canceled to USA
NOTE: The opinions here represent the opinions of the individual posters, and not of Sajha.com. It is not possible for sajha.com to monitor all the postings, since sajha.com merely seeks to provide a cyber location for discussing ideas and concerns related to Nepal and the Nepalis. Please send an email to admin@sajha.com using a valid email address if you want any posting to be considered for deletion. Your request will be handled on a one to one basis. Sajha.com is a service please don't abuse it. - Thanks.

Sajha.com Privacy Policy

Like us in Facebook!

↑ Back to Top
free counters