Got a tip for us? Let us know
Oct 30, 2010, 05:05 PM  #1 
Plotting a stream function in matlab
How does one do this?
I am trying to plot PSI = Acos(6x)Uy where A=1 and U=1 over an x range of 2000200 and y from 20002000 My code is this and it is giving me an error. x = 2000:1:2000; y = 2000:1:2000; si = zeros(x,y); for x = 2000:1:2000 for y = 2000:1:2000 si(x,y) = cos(6*x)y; end end plot(si) Thanks for any help 

0 
Oct 30, 2010, 05:55 PM  #2 
What is the error?
I am not sure what you are trying to do here. Are you trying to make a 3D graph of cos(6*x)  y over x = [2000,2000] and y = [2000,2000] ? 

0 
Oct 30, 2010, 06:28 PM  #3  
Quote:
Quote:
Something that looks like this http://upload.wikimedia.org/wikipedi..._mass_plot.png 

0 
Oct 31, 2010, 09:20 AM  #4  
I never used Matlab, but from the error description
Quote:
for x = 0:1:4000 for y = 0:1:4000 si(x,y) = cos(6*(x2000))(y2000);
__________________
"Everyone knows the inch is better than the centimeter, because it is bigger." 

0 
Oct 31, 2010, 02:03 PM  #5 
In MATLAB arrays always have a lower bound of 1. Your for loops have to be adjusted. Also I think contour() is more suitable instead of plot(). Then you can specify the x and yaxis units.
crackpip 

0 
«
Previous Thread

Next Thread
»
Thread Tools  Search this Thread 
Display Modes  
Similar Threads  
thread  Thread Starter  Forum  Replies  Last Post 
Global function > normal function?  DennisBlah  iPhone/iPad Programming  6  Feb 28, 2014 02:40 AM 
Matlab 2013: What can it be used for?  MacNoobGuy  Mac Basics and Help  3  Sep 24, 2013 01:15 PM 
Matlab help  rokusho1  Mac Basics and Help  2  Nov 8, 2012 07:19 PM 
Plotting the switch, but when?  chaseychasem  MacBook Pro  13  Aug 27, 2012 04:49 PM 
Plotting Multiple Points In New Maps App?  newyorksole  iOS 6  7  Aug 13, 2012 01:12 PM 

All times are GMT 5. The time now is 01:57 PM.