Answered
How to plot multiple answers on the same graph
‘The code is using AIR Tools toolbox.’ I have no idea what that is, and I can’t find it in the File Exchange. I have no idea...

5 years ago | 0

| accepted

Answered
How can I re-orient a polar scatter plot so zero is at the top?
Use polaraxes properties to do this — th = rand(1,10)*2*pi; % Angles r = rand(size(...

5 years ago | 2

Answered
How to solve two functions with two unknown variables and a set of know variable using fsolve function?
The ‘Psat_f’ function needs to have ‘T’ as an argument — % Determine saturated vapor pressure, saturated liquid pressure,& % s...

5 years ago | 1

| accepted

Answered
Convert NASTRAN Sound Pressure Level Data into Time domain Signal
I would reconstruct it with this sort of approach — Fv1 = 0:0.5:200; % ...

5 years ago | 0

| accepted

Answered
need to solve a math.
Use the Symbolic Math Toolbox iztrans function.

5 years ago | 0

| accepted

Answered
How to change the x-axis step size?
Add 'XTick' to the set call — set ( gca, 'xdir', 'reverse', 'XTick',fliplr(SF) ) SF=[12 11 10 9 8 7]; TOA=[1318.91 741.38 ...

5 years ago | 0

| accepted

Answered
Standard deviation of multiple cell arrays
I am not certain what ‘M’ actually is. Try this — M = {rand(5),rand(5),rand(5)} % Create 'M' SD ...

5 years ago | 1

| accepted

Answered
Integral of combined handle functions
Don’t use the Symbolic Math Toolbox for this. Create ‘x’ and ‘y’ as anonymous functions instead, then call them in ‘G’: x =...

5 years ago | 0

| accepted

Answered
Customizing the tick values and labels along x axis
Try something like this: x = [30.0000 28.0000 26.0000 24.0000 22.0000 20.0000 18.0000 16.0000 14.0000 12.000...

5 years ago | 0

| accepted

Answered
fitting a curve using a complex equation as shown
Use lsqcurvefit instead. It does all the ‘heavy lifting’. Try this — format long G f = @(c,w) c(1)+(c(2)*w.^2*c(4)^2./(...

5 years ago | 0

| accepted

Answered
How to integral function and plot it
‘kappat, Gammat, gammat are functions of df.’ I created them (as well as ‘A’, ‘T’, and ‘fun’) as anonymous functions of ‘df’ to...

5 years ago | 0

| accepted

Answered
change magnitude and phase angle to vector
Try this — Mag = [1;2;3;4;5]; % V Phase = [ 0; -22; -0.5; -2; -4]; % Degr...

5 years ago | 1

| accepted

Answered
Divide histogram bins by time
I am not certain what the data are, however a histogram may not be appropriate. Instead, counting the data between two dates or...

5 years ago | 0

Answered
Problem with patch function
I am not certain what you want. Try this — DL = load('XZ.mat'); X = DL.X; Z = DL.Z; figure plot(X(1,:), Z(1,:)) hold...

5 years ago | 1

| accepted

Answered
'ReturnConditions' creates error in 'solve'
Provide output variables, and outputs to return the parameters and conditions: syms i1 i2 gamma phi w r firstfoc=( (2+r)*w/...

5 years ago | 1

| accepted

Answered
Plot values as a box
One approach — barvals = sort(rand(2,5),'descend') % Matrix Defining Limits Of Bars figure plot([1...

5 years ago | 1

| accepted

Answered
I'm trying to plot .csv file
The ‘Time’ variable is a duration array, so the timeofday call is not necessary. Try this — T1 = readtable('https://www.mat...

5 years ago | 0

| accepted

Answered
Match text in cell array and copy to another
This is the best I can do with that. It will likely require a bit of editing later (with respect to the variable names). fil...

5 years ago | 0

| accepted

Answered
How can I plot the integration result?
If you want to plot the cumulative acceleration to get velocity and position, use the cumtrapz function: t = linspace(0, 10); ...

5 years ago | 1

| accepted

Answered
How to do partial differentiation of a function?
This requires the Symbolic Math Toolbox: syms x1 E1 = log((1+x1)/(1-x1)) dE1dx1 = diff(E1,x1) dE1dx1 = simplify(dE1dx1, 50...

5 years ago | 0

| accepted

Answered
How do i get 30% of the data from a vector?
A = [1 7 6 5 3 8 11 23 15 31 4 42 9 82 76 23 41 56 68 90 112] A_1 = A(1:3:end) See Matrix Indexing for details.

5 years ago | 1

| accepted

Answered
How can i changethe value at a position in an array
The ‘k’ array is a (201x201) array of zeros. The code likely works correctly, however using a single index into an array uses l...

5 years ago | 0

| accepted

Answered
why i am not getting fourier transform plot using ezplot command
Since ‘X’ and ‘X2’ are purely imaginary, it is necessary to specify that in the ezplot calls. In MATLAB, imaginary values and i...

5 years ago | 1

| accepted

Answered
Define relationship between variables in an equation
One approach — syms d t eqn = ((t - 21/2)*(d/2 - (20898604612049288806642049279907*t)/70957580590508366543483568128000 + 471...

5 years ago | 0

| accepted

Answered
How to convert the values greater than one to less than one for a matrix stored in workspace
Use rem or mod — v = [1.345, 1.678, 2.345, 3.456, 4.456 0.123 0.456]; vnew = rem(v,1) Using either with the second argument...

5 years ago | 0

Answered
Find an index of a cell whose element satisfies a condition
Try this — c = {[1,2,3], [2,3,1], [3,1,2]}; idx = cellfun(@(x)x(:,2)==1, c, 'Unif',0) Out = find([idx{:}]) .

5 years ago | 0

| accepted

Answered
How to integrate one variable in a multivariate formulation+ nonlinear curvefitting
First, use element-wise operations for everything in the ‘MH’ function. Second, in the integration use the 'ArrayValued',1 na...

5 years ago | 0

| accepted

Answered
Scatter Plot Legend Issue With Assignment
I cannot run the code (no data). That aside, try something llike this — c = [0 0 1; 1 0 0; 0 1 0; 0 1 1; 1 0 1]; figure h...

5 years ago | 1

Answered
How i can get state space model from transfer function?
Apparently you named a script ‘tf2ss’. This overshadows the tf2ss function. The solution is to re-name the script to somethi...

5 years ago | 0

| accepted

Answered
Root finding and plotting
One way is to search for the indices nearest the zero-crossings, then interpolate (if necessary, to get more exact values) — f...

5 years ago | 1

| accepted

Load more