Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

3D modelling in MATLAB

  1. Nov 20, 2011 #1
    How can we merge 3 FFT spectrum graphs in one as shown in the picture?

    I have written the codes for the 3 spectrums but need to join them as shown.

    Attached Files:

    • 3D.PNG
      File size:
      26.6 KB
  2. jcsd
  3. Nov 21, 2011 #2
    Okay here are the steps you need to follow:

    Let's say you have the following data with you.

    X,Y : Value for x,y axes for all the graphs.
    Z1 : Value of Z for the first graph
    Z2 : Value of Z for the second graph
    Z3 : Value of Z for the third graph


    1. Open an empty figure by typing "figure" in the command window.
    2. Click on the window like structure given above in the tool bar just below "Help" (you must have used to type title of the figure and all).

    3. Now when you open it, then either you can see "Figure Palette", if yes then proceed to next 4, otherwise click on the Desktop, and select Figure Palette from there (same as you do to see command window, workspace etc).

    4. There you can see "New Subplots", select 3D Axes as many as you want.
    5. Now once you got three 3D axes on the figure, you can add data to them by right clicking the axes.
    6. Hope it works.

    By the way nice figures :)
  4. Nov 21, 2011 #3
    To implement this in code you'd use the subplot command,

    subplot(1,3,1) % splits the figure into three side-by-side figures and selects the first
    [put code to generate image 1 here]
    [image 2]
    [image 3]
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook