Getting Started with MATLAB Simulations of Basic Equations

In summary, the conversation involves a person who is new to MATLAB and has been assigned a task to simulate a basic equation. They are unsure of how to start and are seeking guidance on how to plot the equation, which involves a variable h and Arterial pressure as the output. Another person provides an example of how to plot a similar equation and suggests using the range function to set the values for h. The conversation then shifts to using Simulink, but the expert is not familiar with it and provides a link for further information. Finally, another person asks for help in finding coordinates in a plot and is seeking an explanation.
  • #1
mit_cool
20
1
Hello friends,
I am new to MATLAB and I have been asigned a task in MATLAB to simulate basic equation..
I have no idea how to start..
The equation is

Arterial pressure= Mean arterial pressure - h*7.46 (h= height)

Can you tell me how to do please?

thankx
 
Physics news on Phys.org
  • #2
what are you trying to do? plot it?

if so here's an example to try first:

a=3
b=5
x = [ 1, 2, 3, 4, 5 ]
y = a*x + b

plot(x,y)

y2=x*x
plot(x,y2)

...
 
  • #3
but how can i relate this to my equation?
yes..I have to plot it ..H is variable and Arterial pressure is output
 
  • #4
so h is the independent variable just like the x in my example where I set
x = [ 1, 2, 3, 4, 5]

there is also a way to set x via a range:
x=1:5:0.1

where x will vary from 1 to 5 by 0.1 increments ie x=[1.0, 1.1, 1.2, 1.3 ... 5]

this should give you enough to solve the problem and plot your results via plot(h,ap)
 
  • #5
Thank you man ..now it is clear..

I have one more question..

I am trying to do same in simulink but can you tell me how to import my variable H in simulink? i mean which block shall I use?
 
  • #7
Thanks again
 
  • #8
Hi am new to MATLAB...I need to find the coordinates of a figure in a plot
but i don't know how ...
kindly explain
 

Related to Getting Started with MATLAB Simulations of Basic Equations

1. What is MATLAB and how is it used in scientific simulations?

MATLAB is a programming language and software environment commonly used in scientific research and engineering. It allows users to perform complex calculations, create visualizations, and analyze data. In the context of simulations, MATLAB can be used to model and solve equations, simulate systems, and analyze the results.

2. What are the basic equations that can be simulated using MATLAB?

MATLAB can be used to simulate a wide range of equations, from simple algebraic equations to complex differential equations. Some common examples include linear equations, polynomial equations, and systems of equations. It can also be used to simulate physical laws and phenomena such as motion, heat transfer, and fluid dynamics.

3. Do I need programming experience to use MATLAB for simulations?

While some basic knowledge of programming can be helpful, it is not necessary to have extensive experience to use MATLAB for simulations. The software has a user-friendly interface and many built-in functions that allow users to perform simulations without writing code. However, having a basic understanding of programming concepts can make it easier to use more advanced features of MATLAB.

4. How accurate are MATLAB simulations compared to real-world experiments?

The accuracy of MATLAB simulations depends on the accuracy of the equations and data used in the simulation. If the equations and data are accurate, the simulation results can closely match real-world experiments. However, there may be some discrepancies due to simplifications or assumptions made in the simulation model.

5. Can MATLAB simulations be used for predictive purposes?

Yes, MATLAB simulations can be used for predictive purposes as long as the equations and data used in the simulation are accurate and the simulation model is well-designed. By inputting different parameters and variables, users can predict how a system may behave under different conditions. However, it is important to validate the simulation results with real-world experiments before making any important decisions based on the predictions.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
Back
Top