MATLAB (an abbreviation of "matrix laboratory") is a proprietary multi-paradigm programming language and numeric computing environment developed by MathWorks. MATLAB allows matrix manipulations, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs written in other languages.
Although MATLAB is intended primarily for numeric computing, an optional toolbox uses the MuPAD symbolic engine allowing access to symbolic computing abilities. An additional package, Simulink, adds graphical multi-domain simulation and model-based design for dynamic and embedded systems.
As of 2020, MATLAB has more than 4 million users worldwide. MATLAB users come from various backgrounds of engineering, science, and economics.
I know these software packages were discussed a lot in the past, but I have not seen much input from the last couple years.
I have used Matlab for many years, but remember using Maple in University Physics courses many years ago. I'm interested in a software package for symbolic math to use...
Mentor node: Added code tags
From=menu('select:','c', 'g', 'a', 's:'); This is part of my code and I'm not coming up with anything close
l=input('input wire length') %current copper=12.5572...
Hi,
I was trying to numerically integrate the following inverse Fourier transform integral,, using the code below. The plot is also shown below.
The plot looks good which means the result is good as well. By the way, I was getting a warning which I quote below the code.
% file name...
Hi PF!
I'm following a tutorial in MATLAB, shown here
t = 0:.001:.25;
x = sin(2*pi*50*t) + sin(2*pi*120*t);
y = x + 2*randn(size(t));
Y = fft(y,251);
Pyy = Y.*conj(Y)/251;
f = 1000/251*(0:127);
plot(f,Pyy(1:128))
title('Power spectral density')
xlabel('Frequency (Hz)')
I read the...
I have a data set 1st coloumn containing ##x## values 2nd coloumn containing ##y## values and 3rd coloumn containing standard deviation of ##y## associated with each ##x## value...I want to plot these 3 values together in a MATLAB plot...can anyone please help me in this regard??
(As a quick note, 'wave flume' should be taken rather generally. I basically just mean the sort of experiments involved in the flow of water which may use instruments such as pressure gauges, load cells, wave gauges, and ADVs. I know that they're not always done in a flume per say -- the...
After completing my sophomore year at college as a Physics major and I realized that the laptop I currently have is not able to keep up with the demand I put it under for school. The laptop I currently have has a <2 hour battery life and has been known to crap out (didn't know how else to...
Hi! I'm working on MATLAB code to analyze dat for a specific project, but I'm curious if it could made useful for more general purposes. Here's a bit of background on the project:
I'm an REU student and I was assigned to analyze data for a recently conducted experiment. The experiment took...
So, Basic premise is I have 1 input and one output, Energy friom the gunpower burning is input, and the output is the force which pushes the bullet after it is reduced by the friction.
m = 12.96 g
s = 0.6985 m (barrel lenght)
E = 6734 J
k = 0.5 (friction coeffcient)
I am sorry for lack of...
If within a volume v ,there exists 10 velocity fields at different points then can anyone please suggest how to compute ##\int_v(\nabla•v)## within the volume?? using matlab
For exm if the velocity vector field be ##v=x\hat x+y\hat y+z\hat z## and for x=1 to 10,y=1 to 10 and z= 1 to 10 the 10...
The plot of part b is attached below.
I got a warning on part a , I don't know where is my mistake .
Please check my work .
Part A
clc;
clear all;
%parta
f=800;
t=0:10e-6:0.005;
xc=10^(-6);
xl=40e-3;
for i=1:(0.005)/(10e-6)
w=2*f*pi;
zeq=xl*j*w+50;
is(i)=2*(1600*t(i)*pi)...
I am new to Simulink and I wanted to start practicing using a spring mass damper system. My first tutorial was this:
Later, I wanted to model a spring system where a mass moving at a known velocity hits the spring. The governing equation and a similar modeling method given in the previous...
Hello, I am trying to find the solution of Schrödinger equation on matlab. However, when I apply boundary conditions, MATLAB only gives me the solution with both coefficients 0. I want to find the solution : Asin(n*pi*x/L)
You can see my code below. Could you please tell me where is my mistake...
Guys I am looking for a textbook about Matlab where In a simple language it will be described how to use this program for solving differential equations. I am more or less aware about calculus but if I have to solve such equations in future – only with this program. So which book could you offer...
I am trying to write an algorithm that generates two random numbers in a given interval such that their ratio is an irrational number. I understand that all numbers stored on a computer are rational, so it is not possible to have a truly irrational number in a simulation. So, instead I am...
For simplicity, let ##N=1##. The following histograms show my results. The generated random numbers are initially exponentially distributed. But after re-scaling they become almost uniformly distributed.
What is the cause of that, and is there a solution?
P.S. Here is my code in Matlab...
My first attempt was:
V=zeros(5,5)
a=1;
i=1:5;
j=1:5;
V(i:j)=a./(i+j-1)
I figured to create a 5x5 with zeros and then to return and replace those values with updated values derived from the Hilbert equation as we move through i and j.
This failed with an error of : Unable to perform assignment...
Hello, I am working on a MATLAB project for my intro to MATLAB course. My project evaluates certain parameters of a spring mass system and graphs the result along with a little mock animation.
inputs the user is allowed to change:
Initial Position at time =0
Initial Velocity at time=0
Mass of...
WHAT HAPPENS IS That I need to model the example of A Protein G example, using a function f in Matlab, but when I execute the script, the graphics I get do not correspond to those of the example.
The problem is that I can not understand what the model seeks to represent, besides that I do not...
Hello!
Happy Sunday, I am trying to create a MATLAB GUI that can take an input ( i am starting out with just one variable) and take its derivative and display the result. I have attached pictures of what my GUI looks like, and also the code I wrote so far.
Let me also describe my method:
I have...
Hello All!
I am finding some inconsistencies with my textbook and MATLAB. I am in the section of symbolic mathematics.
I follow the textbook word for word and I am getting some errors. When I am trying to create an entire equation and give it a name like:
ideal_gas_law=sym('P*V=n*R*Temp') I get...
Hello,
I want to plot this PDE which is non homogeneous:
ut=kuxx+cut=kuxx+c
u(x,0)=c0(1−cosπx)u(x,0)=c0(1−cosπx)
u(0,t)=0u(1,t)=2c0u(0,t)=0u(1,t)=2c0
I have a code that can solve this problem and plot it with those boundary and initial conditions but not with the non homogeneous term...
Hello All,
I have a question regarding a MATLAB homework problem. I am learning about logical functions and selection structures.
Here is the question:
The height of a rocket (in meters) can be represented by the following equation:
height=(2.13*t^2)-(0.0013*t^4)+((0.000034*t^(4.751))
create a...
Help please, I need to solve this differential equation x\frac{\partial^2 U}{\partial x^2}+y\frac{\partial^2 U}{\partial y^2}=aU in Matlab (where "a" is a constant parameter, it can be taken by any), I wanted to use the Partial Differential Equation Toolbox, but I ran into a problem, the...
Hello all:
I want to ask about the command "javac" in MATLAB ?
Any one here knows a useful link on this command other than mathworks ?
Any one have some personal experience about this command ?
Best
H
There is an original image test1.jpg. The problem is to show axes in the image and retain image quality.
I am running the following code:
img = imread('test1.jpg');
% define variables
imgsize1 = size(img,1); % size on screen
imgsize2 = size(img,2);
xreal = 1; % meter
yreal = 1; %...
I wrote the following code in MATLAB:
t = [0:0.001:0.1];
noise = randn(1,size(t,2));
a = 15*10^9;
b = 15*10^(-3);
c = 7*10^8;
y = a*exp(-t/b)+c+noise*100000000;
fun = @(p,t)p(1)*exp(-t/p(2))+p(3);
p0 = [15.5*10^9, 14*10^(-3), 6*10^8];
p = lsqcurvefit(fun, p0, t, y);
t_fit = [0:0.0001:0.1];
y_fit...
Hello all:
I am reading a comutacomputa physics book and trying a code from it in MATLAB it is not working and due to my lack of knowledge in this field I can't see where is the mistake hope you can take a look
import java.lang .*;
public class Motion {
static final int n = 100000, j =...
Homework Statement
Hi,
I am new to MATLAB and have an assignment where I have to construct a Hamiltonian matrix, apply boundary conditions, then find corresponding eigenvalues and eigenvectors for the electron in a box problem. I am stumped where to start. From our class we learned that you...
Hello,
I am trying to do the following:
I have two inputs that are very large files - I extract the first column of each so I have two vectors of ~2-5mil by 1. This is timing information. The goal is to extract the indices of each vector where the time in one vector is within a certain...
I have experimental spectrum in which y-axis is intensity values, and x-axis is frequency values. Int - array of experimental intensities (y-axis). w - array of frequencies (x-axis). I know the view of theoretical function that must describe the obtained spectrum. I explicitly set the function...
Homework Statement
We were given a tutorial to complete which I did complete.
Now the question is:
By modifying the appropriate lines in your script file, find the values of a, b, c, and d so that the cubic polynomial y = ax3 + bx2 + cx + d passes through the (x, y) pairs (-1, 3), (0, 8)...
Dear Sirs,
I have a signal which has an attenuation of 20dB per decade, how do I remove this attenuation using SCIPY? Alternatively how to do it in MATLAB if there are no SCIPY users here?
I'm a SCIPY/MATLAB novice fyg.
Thank you for your kind assistance
Abim
Hello everyone. I have generated a world map by plotting coastlat and coastlon. I have done it because I want to plot some data that I have over said map. The problem is that my data goes only from 70N to 40 S and from 45E to 125W, thanks to that, I have a figure which looks like in the adjoint...
I have attached a picture of what I want Matlab to do. I basically want Matlab to show the list of independent variable 'n' and then another column showing the terms when n=0...10. Some of the outputs are in variable form and others in numerical form.
My attempt so far is stated below. I have no...
I have a little bit confusion that how size command work.can body explain please?. For Example
A=[1 2 3;4 5 6;7 8 9];
size(A)
=3 *3
but size(A,1)=3 and size(A,2)=3 and size(A,3)=1 why is size(A,3)=1?
Hello,
i am trying to solve this equation for x
besselj(0,0.5*x)*bessely(0,4.5*x)-besselj(0,4.5*x)*bessely(0,0.5*x) ==0;
I tried vpasolve, but it gave me answer x=0 only. fzero function didnt work, too.
What function can solve this equation?
Thanks
Hello
I'm working on project for "design & implementation of EMG data acquisition"
for now I completed the design and connected the output of the system to arduino uno to read the emg signal in real time with MATLAB 2017b using arduino support package.
the problem is that the signal looks as...
Hello everyone,
For weeks I have been struggling with this quantum mechanics homework involving writing a code to determine the energy spectrum and eigenvalues for the stationary Schrodinger equation for the harmonic oscillator. I can't find any resources anywhere. If anyone could help me get...
how do you define x to be from minus pi to plus pi in matlab?
i tried:
x = -pi : piBut when i said plot (x,y)
Matlab says:
"Error using plot
Data must be numeric, datetime, duration or an array convertible to double"
(i already defined y interms of x, that function is ok)
so i culd not...
i could use a bit of tutelage with Matlab. I have a rather simple equation I would like to plot. I want to create a rational series of primes divided by their corresponding W value from the equation I have. P are primes 2,3,5,7,11,13... I am still working on this. Thanks
Homework Statement
I would like to solve a multiobjective optimization problem with NSGA II using matlab. The code can be found here https://www.mathworks.com/matlabcentral/fileexchange/10429-nsga-ii-a-multi-objective-optimization-algorithm
I'm looking for a help to implement my objective...
Homework Statement
I am suppose to write a program that compares the FFT (Fast Fourier Transform Diagrams) of a sampled signal without the use of a window function and with it. The window function should be as long as the signal and the signal should have N points, N chosen as to not cause...
Hello! Below is the code for the following task:
matrix "Q" with a dimension of 3*2 was obtained using a matrix of cells "A";
then the matrix "Q" is exported to Microsoft Access with the same dimension (3 rows, 2 columns).
(!) The difficulty is that only the first row of the matrix is written...
A=[ 8147 6324 9575 9572
9058 0975 9649 4854
1270 2785 1576 8003
9134 5469 9706 1419];
D=diag([T^(-3)*L^2 T^(-3)*L^2 T^(-1)*L T^0*L^0]);
I have matrix A whose first two columns are of the units T^3/L^2, third columns unit is T/L, and the last...
I am having a slight issue with my code and honestly cannot understand what I am doing wrong. I am currently trying to using a high pass filter in the frequency domain to form the following image.
So my approach so far after numerous of attempts which I won't list as I believe I am on the...