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.
Homework Statement
uData is a 30x5 matrix with numbers. name_Database is a 30x1 cell array with strings of Names (e.g. Fake Subject 1, Fake Subject 2, Bob). What would fix the code so that the data aligns? (please see image for the misalignment).
Homework EquationsThe Attempt at a Solution...
Homework Statement
Index exceeds matrix dimensions
Homework EquationsThe Attempt at a Solution
I am trying to output into a text file something like this:
Name ID scE ccE scC ccC
Fake Subject 1 1 3 4 5 2
Fake...
I've been using MATLAB (ode45) to simulate the mechanics of a rocket under the forces of gravity, drag, and internal thrust.y I've recently refactored my simulation to include 2d space, orientation of the rocket, etc. (So I can try to make it orbit, finding optimal ascent profiles, etc)...
Homework Statement
this is something i noticed doing homework rather than homework itself. I plot fft output from different frequency signals, i am not sure why power changes with increasing frequency?
Homework Equations
if i take (with MATLAB notation):
time = 0:0.01:10
y =...
i need to create a function that returns the pure zeros on the left semiplane and 0 if there is one and only one zero in the origin of the referential. the return has to be in a column vector like [root1;root2;...;rootn;0] or [root1;root2;...;rootn] if there is no root in the origin of the...
So we're using NXT 2.0 and MATLAB to program a robot to follow a white line through a maze.
I'm using a light sensor, color sensor and an ultrasonic sensor in the process. Any programming/Coding ideas of how i should start?
This is the maze...
Dear All
I was wondering if anyone knew of a tool/library in Matlab that would enable me to convert from galactic to physical image coordinates.
I can read the header file etc of a fits file but I am at a bit of a loss as how to use this information to get real image coordinates.
Cheers
Duane
Homework Statement
I have to come up with a program that calculates the nodal temperatures of a sheet with a slot with 2D conduction. Due to symmetry the shape can be reduced to an L shape. Matlab and loops have always given me trouble, so I tried the Interactive Heat Transfer 4.0...
Hello guys, I'm writing to get some help on an exercise I've been thinking but I can't get to solve.
I have to write the code for the Example 8.5 of the book White, Fluid Mechanics. Here is the problem and the solution I have to obtain.
It is about one duct that has three sections in which I...
I have to analyze a large set of GPS measurement data in MATLAB but when i transfer the list of data in the editor like:
8374847.323
8374827.545
8374863.565
8374831.775
8374889.923
8374872.112
...
How do I put it in a array
A= [value1 value2 value3 ...valueN]?
Homework Statement
Solve (symbolically) the system of linear equations
3x + 4y + 5z = 2
2x - 3y + 7z = -1
x - 6y + z = 3
Check your answer using matrix multiplication.[/B]
Homework Equations
N/A
The Attempt at a Solution
This assignment was given with about 20 different basic MATLAB...
I am trying to crop an image and be able to manipulate in some way (I adjusted contrast) and show change in formatting as its displayed beside the original image (by making it turn more and more blue).
The code runs successfully, but it seems to already have made the cropped image as blue as...
Homework Statement
Generate a triangle. For this problem, generate a triangle at a grid of points that are finely spaced in the x dimension. The triangle is defined as follows:
-Side 1: y = 0 for x = 0 to 2
-Side 2: x = 0 for y = 0 to 1
-Hypotenuse: y = 1-0.5x for x = 0 to 2
Alternatively, the...
Hello everyone,
I'm attempting to come up with a way to calculate the most efficient 7 members truss layout using Scilab.
The assignment is to make a highway sign support.
It has to be L shaped and the truss system is only for the top horizontal part.
Two supports.
The sign is hanging at the...
Hy, I wonder which is the good solution for this problem:
Nonlinear least square problem: function: y = x / (a + b.x) linearization: 1/y = a/x + b substitution: v = 1/y , u = 1/x >> model v = b + a.u
What we did in school:
x = [1 2 4 7]; y = [2 1 0.4 0.1];
v=1./y;
u=1./x;
n = length(x)...
Hy
I want to know how to make linearization for some function,...what should by in Non-linear least squares problems.
In my book I have only this example how to do:
http://i.imgur.com/MUFiHkr.pngSomeone could me help how to do, some receipt of method what I need to do?
Non-linear least...
The question gives the code for MATLAB to solve Hill equation with 5 different values of distance x, which will generate 5 plots on same axis. But the plots will be Force versus time. The question ask you to interpret the relationship between X and F(t).
How do I know this plot represents...
i am trying to figure out digits in a dtmf signal using MATLAB with the fft command however i not sure how to figure out what digit is being pressed.
I am doing this
stem(abs(signal)) and get a plot with several digits pressed but not sure how to figure out which are pressed, any help would be...
Homework Statement
H[/B]ow to create a function to determine the area of a polynomial that has N vertexes in MATLAB?
Homework Equations
p = input('Introduce the number of vertexes of the polynomial:')
n=p-2;
The polynomial can be devided by N-2 triangles and the area of each triangle is given...
I am trying to display the input that I enter into the dialog box from "inputdlg" function into a text file.
This is what I've so far:
prompt={['What is your name?']};
title = 'Name Machine';
answer = inputdlg(prompt, title);
name = answer{1};
fileID = fopen('NameMachineFive.txt', 'w')...
Hi, I want to quiverplot this function in matlab.
>> [X Y] = meshgrid(-2:.2:2,-2:.2:2);
>> X1 = X./(X.^2+Y.^2).^1.5;
>> Y1 = Y./(X.^2+Y./2).^1.5;
>> quiver(X,Y,X1,Y1)
>>
I got this:
What am I doing wrong?
Hi :)
I need to program several nested 'for' loops which differs only in index of their variables inside.
So I need to convert this:
for i1 = 1000:-d:0
for i2 = (1000-(d*i1):-d:0
...
for in = (1000-(d*in-1):-d:0
some function containing all index variables like:
b=(i1*A( :,2), i2*A( :,3), ...
Homework Statement
Write a program for a simple guessing game. The program should first prompt the user for a
number between 1 and 100. After each guess the program should inform the user whether the guess was too high or too low. When the user picks the correct number, inform them and let them...
Hi,
I'm been spending way too much time this weekend, wrestling with the equations provided in the paper [The mutual inductance of two thin coaxial disk coils in air, Babic S., DOI: 10.1109/TMAG.2004.824810], but I just can't seem to verify the results obtained in the examples in the journal...
Homework Statement
This isn't really for homework, but I wasn't sure where else to put it. anyone wishes to move it, that is fine. I'm just getting into some research and I was tasked with reading data from a text file into MatLab and then graphing it by fitting it with exponentials. I am very...
Homework Statement
A = [1 3; 2 4]; %Okay, so we are starting with this matrix
N = 2; %Here we are setting N equal to '2'
for k = 1:N %So here we have a 'for loop' for variable 'k' starting at 1 in increments of '1' up to 'N', which
%happens to be '2' so once this function gets to '2' it...
I am going to do a numerical simulation of diffusion in matlab. The diffusion coefficient is concentration dependant, and i use an array operation to calculate D(x), so it is known.
Based on Fick's second equation:
$$
\frac{\partial C}{\partial t} = \frac{\partial}{\partial x} D \frac{\partial...
When running the following code on Matlab:
>> y(i) = y(i-1) + (0.5 * y.^3 * exp(t^2 + t))*h
I get the error:
? Error using ==> mpower
Matrix must be square.
It seems fairly simple but I'm not quite sure what I'm overlooking. Any help with regards to what I may be doing wrong would be...
Hi, I have newly encountered with a subject called LaTeX. I try to learn it. I know it is a document preparation program. Can I install on my PC and start to use it like Matlab? For example where can I use this code?
http://en.wikipedia.org/wiki/AMS-LaTeX
Thank you.
HI guys,this is my first programming experience , i have developed an MATLAB code for steady state heat conduction equation , on governing equation
dt2 /dx2 + dt2/dy2 = -Q(x,y)
i have solved this equation with finite difference method, As far as i know if we increase the mesh size it leads...
Dear all,
I have time-series data, from which I would like to compute the tricoherence. After some googling, it seems that I will have to write my own code. But before I begin, let me ask this.
Do anyone here know of a code, library (fortran, c), module (python, matlab, IDL, mathematica)...
Hi All:
I am an electrical engineering undergrad. I would like to learn a math plotting software which would be helpful in visualizing topics in advanced calculus (my immediate need). It would also be helpful if the math plotting software was of some use in electrical engineering, but this is...
Hi!
Using Matlab R2012a:
typing this example to create a table:
t = [0 .3 .8 1.1 1.6 2.3]';
y = [.82 .72 .63 .60 .55 .50]';
B = table(t,y)
Getting this error:Undefined function 'table' for input arguments of type 'double'.
Don't know what to do..
Edit:
another example:
>> Age =...
Hi,
I perform my post-processing and analysis of data from silvaco in MATLAB and would like to export values from the .str file to a file that can be read easily into matlab. Does anyone know of a way to do this programmatically? I can do it in tonyplot, but I've got everything else scripted...
Hello,
I am taking MATLAB this summer and will be having a number of questions on this forum about all my bugged code when I make it. Before I begin, I was wondering how do people add those ''code boxes'' when they make a thread that shows all their code within the post.
Thanks
Example: Post...
Hello all, I am trying to plot a simple trajectory in MATlab. Here is the code I wrote,
v0 = 100;
theta = pi/4;
t=0:0.1:20;
horizontal(t)=t.*v0.*cos(theta)
vertical(t)=t.*v0.*sin(theta)-4.905.*t.^2
%teacher gone missing, again, ARRRGGHHH!
title('Ballistic Trajectory of a Projectile')...
I was wondering if anyone has a suggestion for software that can be used to create good looking graphs for e.g Powerpoint presentations?
| have access to a range of packages (Excel, Origin, Matlab) but none of them can create really "slick" locking graphs (but they are fine for figures in...
Hello everyone.
Sorry if the question is silly, but in really need to know something.
We know that The Fourier transform of time is frequency and the inverse of frequency is time.
In Matlab can anyone tell me how to write it ? Because in the book Non linear fiber optics by Agrawal we found that...
Take f = 2x^2 + 1. When I run coeffs(f) in Matlab it outputs [2,1]. However I want it to output all the zero coefficients as well, for example [2 0 1] here. How do I do that?
hi
i'm using Matlab/simulink to create a microgrid model which simulate dynamic control of power based on the loads. the loads are changing based on the realtime. I use several voltage sources to power the loads. I would like to be able to turn on/off the generator based on the loads. for...
Hi,
For some reason, when I run this MATLAB code, I'm getting what looks like about 10,000 for Rf for the largest Vo on the graph, but MATLAB is giving me Rf at (Vo)max as 100,001
Any ideas?
clc;
clear;
close all;
syms Rf
Rf = 0:0.1:100000;
VRt25 = 18.*(10000)./(10000 + Rf)...
Hi,
I have some *.mat files and I need to read them automatically, they are like:
PT2020-RSK1.778-ZONE49.8962.mat
PT2020-RSK2.776-ZONE47.5451.mat
PT2020-RSK3.776-ZONE46.041.mat
PT2020-RSK4.7695-ZONE56.5417.mat
PT2020-RSK5.7667-ZONE48.1113.mat
Are there any ways to load them...
http://i.snag.gy/FBeLq.jpg
I've figured out the first part, (a), it's the second part (b) that's confusing- I've tried re-arranging the plot() function and also tinkering with y1 and y2 rather than y(t), as I get the error:
"Subscript indices must either be real positive integers or logicals."...
From what I have read, FFT seems to simply be faster than DFT, thus making DFT redundant. However, if computational speed is not an issue, are there any advantages of using DFT over FFT (such as increased precision, for example)?
I have a variable number of vectors to concatenate in my Matlab model. Is there a way to do this without a for loop? The number will depend upon input parameters. Suggestions.
Hi Friends,
The code below is for 2D ploting in Matlab, I want to change it in 3D, please if anyone know how to do this.let me know
thanks in advancefigure(1);
popcosts=[pop.Cost];
repcosts=[rep.Cost];
plot(popcosts(1,:),popcosts(2,:),'b.');
hold on;
plot(repcosts(1,:),repcosts(2,:),'r*');
hold...