SineGraph (continue) and 3D Sine

Hey, to continue my original question posted on Thursday (here's the original question):
Hey, I was wondering how do you change the amplitude and the amount of cycles in a Dual Sine Graph. The Dual Sine Graph code is:
// Graph the dual sine graph
// Declare variables and constant
const int SIZE = 41;
double xData[SIZE];
double yData[SIZE];
double zData[SIZE][SIZE];
// Use a for loop to go through each array point
// and store in a number that results from the equation
for (int i = 0; i < 41; i++)
xData[i] = (i - 20.0)/20.0 * PI;
yData[i] = (i - 20.0)/20.0 * PI;
// Use two for loops to go through each matrix point of zData
// and store in the results from an equation
for (i = 0; i < 41; i++)
for (int j = 0; j < 41; j++)
zData[j][i] = sin(xData[i])*cos(yData[j]);
// Convert the native C++ double arrays to NI data types for visualization.
CNiReal64Vector xVector(SIZE, xData);
CNiReal64Vector yVector(SIZE, yData);
CNiReal64Matrix zMatrix(SIZE, SIZE, *zData);
// Plot the data
m_c3DGraph.Plot3DSurface(xVector, yVector, zMatrix);
I am wondering in which part of the code can you change the amplitude and how do you change the amplitude. I am also wondering in which part of the graph can you change the period of the graph and the amount of cycles. For example, if the user wants the graph of amplitude 5, the period 10, and 5 iterations of the graph, how do I write that in code? Thanks."
================
To continue, how do I graph a continuous 2D Sine graph. I know that this code creates a regular sine graph:
// Generate the interval wave vector
CNiMath:ineWave(m_wave, 100, 1);
// Graph the first sine wave
m_cGraph.Plots.Item(1).PlotY(m_wave);
If the user decides to graph, let's say, 10 iterations of the sine graph, how do I write the code for it?"
================
Answer by Elton Wells:
Elton Wells on 7/31/2003 answered:
"Take a look at these two overloads of CNiMath:ineWave:
CNiMath:ineWave(CNiReal64Vector& x, unsigned int samples, double& phase, double amplitude, double freq);
CNiMath:ineWave(CNiReal64Vector& x, double& phase, double amplitude, double freq);
Note that these two overloads take a phase parameter by reference. This parameter specifies the initial phase at function call time and will contain the phase for the next portion of the sine wave at function return time. If you use the same double variable across multiple calls to these overloads of CNiMath:ineWave and if you don't modify the variable between calls, it should give you a continuous signal across the multiple calls.
- Elton"
==================
continuation of question
Here is what I have:
a CWGraph control on the main window dialog
a preferences dialog in which the user enters the amount of iterations
an edit box on the main window dialog that displays the amount of iterations
After the user enters in the iterations, the program should be able to display the SineGraph continuously based on the number of iterations. Each time the sine graph is drawn, the main dialog will display an edit box that shows what iteration it is on. For example, when it is on iteration 4, the sine graph should be drawing its fourth sine wave and the edit box should display the number 4. Do you know how to program this? Is there a way to graph a function then graph it again but resetting where the graph point should start at?
2nd question: in terms of 3D Graphing, how do you change the amplitude in the dual sine graph? How do you change the number of times it will appear on the 3D graph?

To change the amplitude, do the following
zData[j][i] = Amplitude*sin(xData[i])*cos(yData[j]);
To plot multiple iterations(for 2D plot)
for(counter=0;counter less then NUm_of_Iterations;counter++)
/*Generate your data using the Sinwave function, using the same phase variable*/
CNiMath:ineWave(data,samples,phase, amplitude,freq);
/*Using the same phase value will ensure you get a continuous sine wave*/
To plot multiple cycles, see post here
mix and match to apply to 3d graph
Hope this helps
Bilal Durrani
NI
Bilal Durrani
NI

Similar Messages

  • SineGraph (continue)

    Hey, to continue my original question posted today (here's the original question:
    Hey, I was wondering how do you change the amplitude and the amount of cycles in a Dual Sine Graph. The Dual Sine Graph code is:
    // Graph the dual sine graph
    // Declare variables and constant
    const int SIZE = 41;
    double xData[SIZE];
    double yData[SIZE];
    double zData[SIZE][SIZE];
    // Use a for loop to go through each array point
    // and store in a number that results from the equation
    for (int i = 0; i < 41; i++)
    xData[i] = (i - 20.0)/20.0 * PI;
    yData[i] = (i - 20.0)/20.0 * PI;
    // Use two for loops to go through each matrix point of zData
    // and store in the results from an equation
    for (i = 0; i < 41; i++)
    for (int j = 0; j < 41; j++)
    zData[j][i] = sin(xData[i])*cos(yData[j]);
    // Convert the native C++ double arrays to NI data types for visualization.
    CNiReal64Vector xVector(SIZE, xData);
    CNiReal64Vector yVector(SIZE, yData);
    CNiReal64Matrix zMatrix(SIZE, SIZE, *zData);
    // Plot the data
    m_c3DGraph.Plot3DSurface(xVector, yVector, zMatrix);
    I am wondering in which part of the code can you change the amplitude and how do you change the amplitude. I am also wondering in which part of the graph can you change the period of the graph and the amount of cycles. For example, if the user wants the graph of amplitude 5, the period 10, and 5 iterations of the graph, how do I write that in code? Thanks."
    ================
    To continue, how do I graph a continuous 2D Sine graph. I know that this code creates a regular sine graph:
    // Generate the interval wave vector
    CNiMath:ineWave(m_wave, 100, 1);
    // Graph the first sine wave
    m_cGraph.Plots.Item(1).PlotY(m_wave);
    If the user decides to graph, let's say, 10 iterations of the sine graph, how do I write the code for it?"
    ================
    Answer by Elton Wells:
    Elton Wells on 7/31/2003 answered:
    "Take a look at these two overloads of CNiMath:ineWave:
    CNiMath:ineWave(CNiReal64Vector& x, unsigned int samples, double& phase, double amplitude, double freq);
    CNiMath:ineWave(CNiReal64Vector& x, double& phase, double amplitude, double freq);
    Note that these two overloads take a phase parameter by reference. This parameter specifies the initial phase at function call time and will contain the phase for the next portion of the sine wave at function return time. If you use the same double variable across multiple calls to these overloads of CNiMath:ineWave and if you don't modify the variable between calls, it should give you a continuous signal across the multiple calls.
    - Elton"
    ==================
    continuation of question
    Here is what I have:
    a sine graph on the main window dialog
    a preferences dialog in which the user enters the amount of iterations
    After the user enters in the iterations, the program should be able to display the SineGraph continuously based on the number of iterations. Each time the sine graph is drawn, the main dialog will display an edit box that shows what iteration it is on. For example, when it is on iteration 4, this is the 4th continuous sine wave, the edit box will display the number 4. Do you know how to program this?

    Elliot,
    I would set up a timer, and in the timer callback plot the next set of data and updete a counter, when the number of iterations is doen you can disable the timer until the user restarts the sinewave generation.
    There is a possible problem that I see here, if you generate 1 cycle of the sine wave in the timer callback and this cycle has the same phase then you wont see any actual change in the graho since the data will be the same. Just make sure that you actually have different data ploted.
    I hope this helps,
    Juan Carlos
    N.I.

  • Difference between continue and Exit ........?

    Difference between continue and Exit ........

    See a small example CONTINUE below with some notes:-
    When Nothing to Do, CONTINUE: - In Oracle Database 11g PL/SQL has a new construct called CONTINUE, which is used in a loop. The statement moves the logic to the end of the loop and then to the beginning of the loop.
    Eg:
    begin
            for ctr in 1..100 loop
                    continue when mod(ctr,10) != 0;
                    dbms_output.put_line ('ctr='||ctr);
                      Continue Skip the executions of statements after this clause Like for numbers, those are not a multiple of 10. And comes to end loop then to start of loop          
            end loop;
    end;
    Here is the output:
    ctr=10
    ctr=20
    ctr=30
    ... and so on ...EXIT take you out of LOOP from current iteration and that will be last iteration.
    Thanks!

  • Im trying to update my apps and it wont let me. When i clicked on an app to update it or to download a free app it says "sign in required, tap continue and sign in to view your billing information" when i did it says "you must verify your payment info be

    Im trying to update my apps and it wont let me. When i clicked on an app to update it or to download a free app it says "sign in required, tap continue and sign in to view your billing information" when i did it says "you must verify your payment info before you can makes purchases" then "security code is invalid" when the security code is valid. I even switched credit card it keeps saying the same thing....... THIS IS NOT FAIR........ I WANNA UPDATE MY APPS!!!!! Btw idk why did i buy the ipad for, APPLE dont even let you download ADOBE FLASH PLAYER and must of the games required ADOBE FLASH PLAYER to play example: wizard101. Idk what i was thinking...... :(

    Why not simply remove yoru payment info by selecting None at top?
    APPLE dont even let you download ADOBE FLASH PLAYER
    Considering Adobe dont (sic) even make Flash Player for iPads, this seems about right. How can you download something that does not exist?

  • How can I make auto the continue and come from?

    Hi:
    Please sorry my grammar. I try to explain better as I can.
    Let's see. I have included some internal links such as "continued on page XX" and "comes from page XX" for some items. The problem is that as I add artwork or text, the number of pages varies, and so I have to edit the "continue" and "comes from" manually. Is there any way that InDesign assign the number of pages automatically? I mean, for example, when I indicate to a text box where you should continue (usually another text box), just that I do but whith the page number of the expressions "continue" and "comes from".
    I hope that I explain it well.
    Regards from Lima, Perú

    In English, these are called Jump Lines. If you already have a text frame that reads: continued on page XX, delete the XX, place the cursor after continued on page and go to Type>Insert Special Character>Markers>Next Page Number. Do the same with the continued from page XX, but use Type>Insert Special Character>Markers>Previous Page Number.
    If you have a story that spans two or more text frames, placing a jump line frame so that it touches one of the  frames of a threadded story, it will display either the page number of the previous or next frame in the thread.

  • When i log on to itunes it will tell me to review my account and when i do i click continue and it says my session has timed put and i have only been on for 2 seconds

    when i log on to itunes it will tell me to review my account and when i do i click continue and it says my session has timed put and i have only been on for 2 seconds

    Place the Device into Recovery mode...  See Here...
    http://support.apple.com/kb/HT1808

  • I have downloaded Photoshop elements 5.0 to a new PC.  I recieve error message: "Your Adobe Photoshop Elements user name, organization, or serial number is missing or invalid. The application cannot continue and must now exit."

    I was referred here by customer service.  I have downloaded Photoshop elements 5.0 to a new PC.  After accepting the agreement I receive an error message saying  "Your Adobe Photoshop Elements user name, organization, or serial number is missing or invalid. The application cannot continue and must now exit."  There is no place to enter the serial number.

    All your pictures will remain safe even after uninstalling the program. Your pictures are saved to your system in form of catalog present at C:\ProgramData\Adobe\Photoshop Elements\Catalogs\<your catalog><br />When you reinstall the program you can open this catalog and view all your photos again.

  • HELP ASAP!! PSE5 "elements user name organization or serial number is missing or invalid.  thsi application cannot continue and must now exit

    HELP!!!!  I am a graphic designer I LOVE my version of Photoshop elements 5... I am also a Mom of two who depends on my party supply business as my only income currently!!!! 
    Upon opening to work on a party supply order DUE TODAY for a kid's first birthday I got this ERROR MESSAGE:
    "Your adobe photoshop elements user name organization or serial number is missing or invalid.  This application cannot continue and must now exit"  And then closes.....
    I don't know where my disc is to uninstall/reinstall since I got this program Oh say 10 years ago....  WHAT DO I DO!!?  I am in complete PANIC mode!
    Anyone?! Chat said they couldn't help me it's too old?!?!  HELP

    Hello ...Mom,
    here you will find (if stored at Adobe) "General infos about your Adobe Account" https://www.adobe.com/account.html. To see what Adobe has saved about your serial number, please have a look there: http://helpx.adobe.com/x-productkb/global/find-serial-number.html.
    On the other hand you could use a non Adobe program, like
    Belarc Advisor - Free Personal PC Audit, for software, hardware and security configuration information on your computer.…
    If necessary and for further questions click through http://helpx.adobe.com/contact.html and if "open" please use chat, I had the best experiences. I quote from Adobe's employee Preran: The chat button is activated as soon as there is an agent available to help.
    Good luck!
    Hans-Günter

  • An uninvited web page comes up when i am working on the net. It takes over and then when i try to close it an information window comes up that says close to continue and cancel to stay on this page. well I can't close it and i dont' want to continue.

    How do i close a page that says hit close to continue and cancel to stay on the page?

    Do a malware check with a few malware scan programs.<br />
    You need to use all programs because each detects different malware.<br />
    Make sure that you update each program to get the latest version of the database before doing a scan.<br />
    * http://www.malwarebytes.org/mbam.php - Malwarebytes' Anti-Malware
    * http://www.superantispyware.com/ - SuperAntispyware
    * http://www.safer-networking.org/en/index.html - Spybot Search & Destroy
    * http://www.lavasoft.com/products/ad_aware_free.php - Ad-Aware Free
    * http://www.microsoft.com/windows/products/winfamily/defender/default.mspx - Windows Defender: Home Page
    See also "Spyware on Windows": http://kb.mozillazine.org/Popups_not_blocked and [[Searches are redirected to another site]]

  • I click on mail and it says it must import my messages. Then I click continue and it says import failed

    I have a Macbook Pro Laptop. I click on mail and it says it must import my messages. Then I click continue and it says import failed. 

    Lion ate ALL my Mail: Apple Support Communities

  • My podcast displays as continuous and won't display in iTunes.

    My podcast displays as continuous and won't display time or download in iTunes. My RSS feed is http://feeds.feedburner.com/AfterRealityTvPodcast
    My first post displays fine but this does not.
    Any help is appreciated.
    Best,
    Spencer

    I was able to subscribe to your podcast; both episodes showed and the latest one started downloading (I didn't download it fully), so everything seems OK in that respect. The Store is showing only the first episode: it's too soon to expect to see the latest episode there as it was only posted today. The first episode plays OK in the Store.
    Your server does handle 'byte range requests' as required for iPhones so that should be OK.
    The reason it's sayinng 'continuous' when subscribing is that you have no 'itunes:duration' tags containing the duration of the episode. I can't advise on how you would enter this information in Blogger, but I would expect it to be possible.
    If you are unable to play episodes when subscribing or from the Store there is some problem local to your Mac or iPhone. Perhaps you can get a friend to check whether they can play it, but I would expect them to be able to as I had no problems.

  • HT201209 When I press redeem it asks me to sign in and then enter my iTunes card code. After entering in my iTunes card code it then asks me three times for my password. Right after it says: Error press continue and sign in to redeem code. Please help me

    why is it whenever I sign in and put in my code it asks me three times for my password and then says: "Error press continue and sign in to redeem code." I really need help because I have three fifteen dollar cards that I want to put on! I had four but then for some reason the first one worked after a long time of trying but the other ones didn't. I have the latest version and all my stuff is updated.

    You might have mentioned that. Your next step would be to contact iTunes Support:
    iTunes Support WorldWide
    Cheers,
    GB

  • Sign in required Tap Continue and sign in to check for downloads popup

    Hi All,
    I have implemented Auto Renewable App purchasases in my application, everything is working fine.
    We are testing the app throughly and for each and every condition possible(network down,hundreads of sandbox users  etc).
    While testing the things many times we are stopping the transaction in beteween but after some time we were restoring the same transaction and it works after that.So far so good.
    Now on many ipads we are getting the message popup saying "sign in required Tap Continue and sign in to check for downloads".
    I dont know what this means because i have already purchased the product in sandbox and evrything works great but many times this poup is irritating us so please lt us know the solution for same.
    Please let me know how to get rid of this error asap.Because of this error only Our QA's are not releasing the app.
    Please help me out to solve this asap.

    Same here, this is an irritating issue. I am getting this with non-renewing subscriptions.

  • Hello, I currently have a MacBook snow leapord and i'm trying to connect it with my Canon MP560 printer, i put in the CD and installed everything properly but now when i add a printer it says a Queue already exists, i click continue and nothing happens???

    Hello,
    I'm using a MacBook Snow Leapord and I'm trying to connect it with my Canon MP560 printer/scanner.
    I installed the CD and followed along with the manual and did everything it asked, at the end it told me it was finished.
    So then I went to go print something and an error had occured so i went to the file menu on Microsoft Word for
    Mac and clicked Print/Add Printer and then i click on the Canon MP560 series-1 as it was the only one to click on.
    When I did it stated that I already has a Queue for this printer and if I'd like to add a new one so I clicked continue and nothing
    had happend. PLEASE HELP
    sincerely,
    Laura.

    I would recommend to download the driver appropriate for your system from the Canon webiste or, after installing it, to run software update and it will detect it for you.
    If you have the last driver appropriate for your system, you may wish to reset the printing system. To do this, go to Sys prefs/print and fax and, upon clicking minus button, also press Option/alt key. You will be asked to confirm, do it. Then, add the printer by pressing plus button, it should work now.
    But, before doing this, download the last good driver, CDs usually contain outdated drivers.

  • I'm trying to update my apps on my iphone 4s, but it keeps telling me to tap continue and view billing information, what do I do?

    I'm trying to update my apps on my iphone 4s, but it keeps telling me to tap continue and view billing information, what do I do?

    Sounds like the credit card you have on file is probably invalid/expired.   You'd need to correct that or set the payment method to None.

Maybe you are looking for