plot a line c

1 view (last 30 days)
Mark
Mark on 16 May 2014
Edited: Image Analyst on 28 May 2014
Hi I need someone who can code two parallel wave function. I also need the step function color code red and green (both open). The total period of wave should.
  3 Comments
Image Analyst
Image Analyst on 17 May 2014
I know how to plot a circle or a portion of it - that's in the FAQ - but I don't know what a parallel wave function is, nor a "step function color code red and green (both open)". Maybe you can provide a screenshot of what you'd like to obtain - mock something up in Photoshop, Paint, or Gimp if you have to.
Star Strider
Star Strider on 17 May 2014
Define, specifically and with reasonable mathematical precision, ‘wave function’. Do you mean the solution of the Schrödinger equation? This doesn’t quite fit with my concept of ‘step’ function, but mayhap I’m missing something. Could be the step is both dead and alive?
Your y variable was real over the domain (0, 2*pi) when I ran it, although it looked a bit strange. Likely over a negative domain it would be complex, (because of the sqrt) but since you didn’t specify its support or domain, we don’t know.
We can probably ‘combine all the first 8 semicircle into a wave function’ but we would first have to know the semicircle-to-wave function mapping or integral trasnform. The Internet is not revealing that secret, at least not tonight.
This all seems quite strange to me. If you have the PDF of one or more papers on it in English and from a referred journal, please attach it to your original post (use the ‘paperclip’ icon). The quantum mechanics among us might be able to fix it and get it running. If the authors used a recent version of MATAB, and if there is a link to their entire MATLAB code (in Online supplements), that would be best.

Sign in to comment.

Answers (1)

Image Analyst
Image Analyst on 17 May 2014
Seems like you got something that works for you for one cycle. So just use repmat() to replicate this 8 times. That's about as much as I can get from your post since I don't understand it. A picture of the desired plot would be most helpful.
  3 Comments
Image Analyst
Image Analyst on 18 May 2014
Try this:
workspace;
x = -2:.1:2;
y = sqrt(4-x.^2);
subplot(2,1,1);
plot(x,y,'bs-', 'Linewidth', 2);
grid on;
y8 = repmat(y, [1,8]);
x8 = linspace(-2, length(y), 8*numel(y));
subplot(2,1,2);
plot(x8,y8,'bs-', 'Linewidth', 2);
grid on;
% Enlarge figure to full screen.
set(gcf, 'Units', 'Normalized', 'OuterPosition', [0 0 1 1]);
% Give a name to the title bar.
set(gcf, 'Name', 'Demo by ImageAnalyst', 'NumberTitle', 'Off')
Image Analyst
Image Analyst on 19 May 2014
Edited: Image Analyst on 28 May 2014
Mark, I gave an example like you asked me for - did my example help?

Sign in to comment.

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!