Answered

how to make smooth the vertcat of more vectors

I am not certain what you want, since the posted file is not the same as the posted plot image. Try this: y = readmatrix('c...

how to make smooth the vertcat of more vectors

I am not certain what you want, since the posted file is not the same as the posted plot image. Try this: y = readmatrix('c...

15 days ago | 0

| accepted

Answered

How to print Rsdnrm after fitting?

The ‘Rsdnrm’ output is a scalar double value, and exists in the workspace after lsqcurvefit completes its estimation. Just use ...

How to print Rsdnrm after fitting?

The ‘Rsdnrm’ output is a scalar double value, and exists in the workspace after lsqcurvefit completes its estimation. Just use ...

15 days ago | 0

Answered

drawcircle function outputs circle or oval by default?

Use: axis('equal') and it magically becomes a circle! See the documentation on axis for details.

drawcircle function outputs circle or oval by default?

Use: axis('equal') and it magically becomes a circle! See the documentation on axis for details.

15 days ago | 0

Answered

How to find the upper limit of a complex integral

I’ve been working on this for a while. This works, however at some point, fsolve finds undefined values at the intial point, ...

How to find the upper limit of a complex integral

I’ve been working on this for a while. This works, however at some point, fsolve finds undefined values at the intial point, ...

15 days ago | 0

| accepted

Answered

How to fix my code for ode45

Delete the single quotation marks. This runs without error: f = @(x,y) (9*14^(1/2)*exp(-(2*x)/9)*sin((14^(1/2)*x)/9))/7; [...

How to fix my code for ode45

Delete the single quotation marks. This runs without error: f = @(x,y) (9*14^(1/2)*exp(-(2*x)/9)*sin((14^(1/2)*x)/9))/7; [...

15 days ago | 0

| accepted

Answered

What is wrong with my code it keeps telling me that i have 'Error: File: labmaterials.m Line: 67 Column: 109 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

The problems are too many to specifically enumerate: Ms(iii)=2/pi*(w1*log*[tan*[acos*[w1/l_vector]]+l_vector/w1]+l_vector*(pi/...

What is wrong with my code it keeps telling me that i have 'Error: File: labmaterials.m Line: 67 Column: 109 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

The problems are too many to specifically enumerate: Ms(iii)=2/pi*(w1*log*[tan*[acos*[w1/l_vector]]+l_vector/w1]+l_vector*(pi/...

16 days ago | 0

| accepted

Answered

Plot / Solve system for nontrivial answer. dot operator issue?

Since you wnat a numeric result, use vpasolve instead, wither with an initial value (if you have an idea of what that is) or a r...

Plot / Solve system for nontrivial answer. dot operator issue?

Since you wnat a numeric result, use vpasolve instead, wither with an initial value (if you have an idea of what that is) or a r...

16 days ago | 0

| accepted

Answered

Should I use the absolute value of fast Fourier transform or the conjugate in signal analysis?

Note that the plot is ‘Power Spectral Density’. Power is the square of magnitude. The abs value is the square root of the co...

Should I use the absolute value of fast Fourier transform or the conjugate in signal analysis?

Note that the plot is ‘Power Spectral Density’. Power is the square of magnitude. The abs value is the square root of the co...

16 days ago | 0

| accepted

Answered

How can I solve a problem related to the output argument.

The way I usually deal with this is to define all the outputs as NaN in the beginning of the function. The ones that are assign...

How can I solve a problem related to the output argument.

The way I usually deal with this is to define all the outputs as NaN in the beginning of the function. The ones that are assign...

16 days ago | 0

Answered

Matlab on a new computer

First, back up all your user files (including yuour startup.m file if you created one) to a thumb drive or SD chip and transfer ...

Matlab on a new computer

First, back up all your user files (including yuour startup.m file if you created one) to a thumb drive or SD chip and transfer ...

16 days ago | 0

Answered

Plotting mean across a graph

Try this: plot(xlim, [1 1]*Ymean, 'r','LineWidth',1.5) The ‘Ymean’ value should be a constant, so it is necessary to plot it ...

Plotting mean across a graph

Try this: plot(xlim, [1 1]*Ymean, 'r','LineWidth',1.5) The ‘Ymean’ value should be a constant, so it is necessary to plot it ...

17 days ago | 0

Answered

How to get fmincon to work with an ode45?

See: Optimizing a Simulation or Ordinary Differential Equation

How to get fmincon to work with an ode45?

See: Optimizing a Simulation or Ordinary Differential Equation

17 days ago | 0

| accepted

Answered

XLabel and YLabel Font Size

The Control System (and System Identification) Toolbox plot functions properties are difficult to change. That can be done, how...

XLabel and YLabel Font Size

The Control System (and System Identification) Toolbox plot functions properties are difficult to change. That can be done, how...

17 days ago | 0

| accepted

Answered

load x,y

Try this: x = 1:10; y1=[0.5 1.7 1.75 1.9 2 2.1 2.4 2.6 2.7 2.9 ] y2=[0.7 1.8 1.9 2 2.3 2.5 2.7 2.8 2.9 3] save('XYvectors...

load x,y

Try this: x = 1:10; y1=[0.5 1.7 1.75 1.9 2 2.1 2.4 2.6 2.7 2.9 ] y2=[0.7 1.8 1.9 2 2.3 2.5 2.7 2.8 2.9 3] save('XYvectors...

17 days ago | 0

| accepted

Answered

Drawing contour on circle with individual(x,y,z) location spots

Use the contour function. If they are not already gridded (in a regularly-spaced 2D array), use the griddata (or related func...

Drawing contour on circle with individual(x,y,z) location spots

Use the contour function. If they are not already gridded (in a regularly-spaced 2D array), use the griddata (or related func...

17 days ago | 0

| accepted

Answered

How do I plot 3 dimensional function?

Code it, and include the contourf function in your code to produce the plot.

How do I plot 3 dimensional function?

Code it, and include the contourf function in your code to produce the plot.

17 days ago | 0

Answered

Printing lines of text from cell array?

One approach: D = {[1 2 3],[4 5 6 7 8 9],[10 11 12 13 14 15 16 17 18 19 20]} for k = 1:numel(D) fprintf(1, [repmat('%d...

Printing lines of text from cell array?

One approach: D = {[1 2 3],[4 5 6 7 8 9],[10 11 12 13 14 15 16 17 18 19 20]} for k = 1:numel(D) fprintf(1, [repmat('%d...

17 days ago | 0

| accepted

Answered

Signal Analyzer - Unable to view Complex Signal

I am not sure that I understand the problem. The ‘env’ and ‘g’ variables appear in my Workspace (in R2020b). There are sever...

Signal Analyzer - Unable to view Complex Signal

I am not sure that I understand the problem. The ‘env’ and ‘g’ variables appear in my Workspace (in R2020b). There are sever...

18 days ago | 0

Answered

changing header to csv using writetable

In R2016b, the variable names must be valid MATLAB variable names. (That changed in R2020a, so what you want to do would be per...

changing header to csv using writetable

In R2016b, the variable names must be valid MATLAB variable names. (That changed in R2020a, so what you want to do would be per...

18 days ago | 0

| accepted

Answered

Use Delimiter only once in row when reading .txt files

Try this: C = {'$CM_TIME 11:44 AM' '$CM_OPERATOR Microscope Administrator' '$CM_INSTRUMENT Microscope' '$CM_...

Use Delimiter only once in row when reading .txt files

Try this: C = {'$CM_TIME 11:44 AM' '$CM_OPERATOR Microscope Administrator' '$CM_INSTRUMENT Microscope' '$CM_...

18 days ago | 0

| accepted

Answered

How to solve ODE (vector of first order equations)?

The numerical ODE solvers pass a time scalar and a vector to the ODE functions they integrate, in that order, so the function mu...

How to solve ODE (vector of first order equations)?

The numerical ODE solvers pass a time scalar and a vector to the ODE functions they integrate, in that order, so the function mu...

18 days ago | 0

| accepted

Answered

Bug in patch rendering?

If you do not need the edge lines to be displayed, 'EdgeColor','none' will eliminate all of them in the specific patch call that...

Bug in patch rendering?

If you do not need the edge lines to be displayed, 'EdgeColor','none' will eliminate all of them in the specific patch call that...

18 days ago | 0

Answered

Plotting a Distribution of Molecules

The erf function is your friend! Specifically: x = linspace(-5, 5); y = gradient(erf(x)) ./ gradient(x); figure plot(x...

Plotting a Distribution of Molecules

The erf function is your friend! Specifically: x = linspace(-5, 5); y = gradient(erf(x)) ./ gradient(x); figure plot(x...

19 days ago | 0

Answered

Why my plot doesn't show the line?

If you must use a loop, you need to subscript ‘f1’: f1(i) = 1/(10*i/(c+10)); However a loop is not necessary. Using element-...

Why my plot doesn't show the line?

If you must use a loop, you need to subscript ‘f1’: f1(i) = 1/(10*i/(c+10)); However a loop is not necessary. Using element-...

19 days ago | 1

| accepted

Answered

Slope of a plotted function in a specified point.

It would be easier to have your data. Try this: xv = linspace(0, 5); ...

Slope of a plotted function in a specified point.

It would be easier to have your data. Try this: xv = linspace(0, 5); ...

19 days ago | 0

Answered

Interpolate, find - excel lookup equivalent

The table appears to work stepwise. The interp1 function can interpolate using several options, here 'previous', 'nearest', and...

Interpolate, find - excel lookup equivalent

The table appears to work stepwise. The interp1 function can interpolate using several options, here 'previous', 'nearest', and...

19 days ago | 0

| accepted

Answered

Plot is generating a series of vectors instead of a continuous line plot

I have no idea what ‘Df’ and ‘Zf’ are, so I created one of them and simulated the data: Zf = {rand(143,1); rand(380,1); rand(1...

Plot is generating a series of vectors instead of a continuous line plot

I have no idea what ‘Df’ and ‘Zf’ are, so I created one of them and simulated the data: Zf = {rand(143,1); rand(380,1); rand(1...

19 days ago | 0

Answered

Finding x value at 10% of max y value, after the max

It would be necessary to have a sample of your data to write specific code, so I will simply describe the procedure. First, u...

Finding x value at 10% of max y value, after the max

It would be necessary to have a sample of your data to write specific code, so I will simply describe the procedure. First, u...

19 days ago | 0

Answered

'Matrix dimensions must agree' error

Vectorise all multiplication, division and exponentiation operations, and it works: Re = 190000:10000:290000; Pr = 3.66:0.5:5...

'Matrix dimensions must agree' error

Vectorise all multiplication, division and exponentiation operations, and it works: Re = 190000:10000:290000; Pr = 3.66:0.5:5...

20 days ago | 0

Answered

How to plot x^2 - y^2 = 1?

Try this: syms x y figure fimplicit(x^2 + y^2 -1, [-1 1]) axis('equal') .

How to plot x^2 - y^2 = 1?

Try this: syms x y figure fimplicit(x^2 + y^2 -1, [-1 1]) axis('equal') .

20 days ago | 2

| accepted