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

MathCAD programming help

Tags:
  1. Sep 13, 2010 #1
    Mods, I wasn't sure where to put this, so please move it if its not in the correct section. Thank you.

    I am in a computer structural analysis class that utilizes MathCAD as the means for all computations throughout the semester. I've never used it before, so Im having some issues. I have the book "Essential MathCAD", but there are a couple items I can't seem to find in the book (perhaps I'm looking in the wrong section?).

    Anyways, the primary reason for using MathCAD in this class is to develop custom routines for doing very specific calculations. I have experience programming in VB and C++/Java; however, I'm finding it quite the PITA to program in MathCAD. One major pet pieve of mine is that I can't seem to figure out a way to add a new line in the middle of an existing routine. Every time I try clicking "add a line" in the programmer's toolbox, it does some crazy stuff and adds parenthesis and/or rearranges a bunch of stuff in the routine. No matter where the cursor is when I click "add a line", it never simply adds a line (or it adds it in the totally wrong place). Doing this in Java is beyond simple, its like adding a line in a Word document...no funny business happens. Can someone give me some guidance on this?

    The next thing I'm stuck on is the output from the routine. In my particular homework assignment, I need to have an output for a particular error that includes one of the arguments in the output. It doesn't appear that this can be done with the "return" function.

    Lastly, the program is supposed to exit if I have an "i" or "k" greater than the amount of rows or columns. I put a "break" function into the program, but when I execute it with the error, the program outputs "5". It doesnt matter what I change up for i & k, it still outputs "5" for some reason.

    Below I have posted my assignment and my solution thus far. If you could help me out with anything, I'd appreciate it. Also, I feel like my routine is much longer than it needs to be (although it does work correctly as is), so any advice on consolidating the code is much appreciated. Thanks.

    p.s.- Sorry, I posted pix because I wasn't sure how to copy the code from MathCAD...selecting and copying didn't do anything :/

    pic1.png
    pic2.png
    pic3.png
     
  2. jcsd
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted



Similar Discussions: MathCAD programming help
  1. Help with Mathcad (Replies: 1)

  2. MathCAD help? (Replies: 1)

Loading...