Answered

Graph not showing up

Use the axis function to see it: a=9; b=2; c=5; d=5; x=[ a a a b b c]; y=[ b c d c d d]; plot(x,y) axis([0 10 0 6]) ...

Graph not showing up

Use the axis function to see it: a=9; b=2; c=5; d=5; x=[ a a a b b c]; y=[ b c d c d d]; plot(x,y) axis([0 10 0 6]) ...

14 días ago | 1

Answered

How to fit two data sets, y1 and y2, to different functions with shared parameters.

This problems requires lsqcurvefit since the fit is to a matrix and not vector dependent variables: y1 = rand(10,1); ...

How to fit two data sets, y1 and y2, to different functions with shared parameters.

This problems requires lsqcurvefit since the fit is to a matrix and not vector dependent variables: y1 = rand(10,1); ...

14 días ago | 0

Answered

Go from Local Time to UTC with respect to the dates I have!

The data in your Excel file need a bit of preprocessing, then the conversion is straightforward: D = readtable('Date-Time.xlsx...

Go from Local Time to UTC with respect to the dates I have!

The data in your Excel file need a bit of preprocessing, then the conversion is straightforward: D = readtable('Date-Time.xlsx...

14 días ago | 0

| accepted

Answered

Filling with colour the space inside object

Perhaps you can adapt the solution in: fill area between two polar curves to your problem.

Filling with colour the space inside object

Perhaps you can adapt the solution in: fill area between two polar curves to your problem.

14 días ago | 0

| accepted

Answered

How to plot multiple curves in the same graph window?

Try this: J=20.48*10e-6; b=0.702; kt=14.70; kb=0.48; R=1.6; L=0.02*0.001; num=kt; den=[(J*L) ((J*R)+(L*b)) ((b*R)+(kb*k...

How to plot multiple curves in the same graph window?

Try this: J=20.48*10e-6; b=0.702; kt=14.70; kb=0.48; R=1.6; L=0.02*0.001; num=kt; den=[(J*L) ((J*R)+(L*b)) ((b*R)+(kb*k...

15 días ago | 0

| accepted

Answered

convert date to number

This appears to do what you want: This = '00:01:36.480'; NowThis = datetime(This, 'InputFormat','HH:mm:ss.SSS', 'Format','HHm...

convert date to number

This appears to do what you want: This = '00:01:36.480'; NowThis = datetime(This, 'InputFormat','HH:mm:ss.SSS', 'Format','HHm...

15 días ago | 0

Answered

Reading Text file with headers

Another approach: txt = fileread('X.txt'); timepos = strfind(txt,'Time:'); endpos = strfind(txt, 'end'); for k = 1:numel(ti...

Reading Text file with headers

Another approach: txt = fileread('X.txt'); timepos = strfind(txt,'Time:'); endpos = strfind(txt, 'end'); for k = 1:numel(ti...

16 días ago | 0

| accepted

Answered

Importing multiple .odt files with specific row and column ranges into Matlab.

If you have R2019a or later, see if the readmatrix function will read it. Then see: Import or Export a Sequence of Files.

Importing multiple .odt files with specific row and column ranges into Matlab.

If you have R2019a or later, see if the readmatrix function will read it. Then see: Import or Export a Sequence of Files.

16 días ago | 0

Answered

Bode plot of the following equation

Perhaps: s=tf('s'); U=(8+22/s+32*s); [m,p,w] = bode(U); figure subplot(2,1,1) plot(w, 20*log10(squeeze(m).^0.2)) yla...

Bode plot of the following equation

Perhaps: s=tf('s'); U=(8+22/s+32*s); [m,p,w] = bode(U); figure subplot(2,1,1) plot(w, 20*log10(squeeze(m).^0.2)) yla...

16 días ago | 0

Answered

Why fft dosen't conserve energy?

From the fft documentation: Y = fft(X,n) returns the n-point DFT. If no value is specified, Y is the same size as X. If X is ...

Why fft dosen't conserve energy?

From the fft documentation: Y = fft(X,n) returns the n-point DFT. If no value is specified, Y is the same size as X. If X is ...

16 días ago | 0

| accepted

Answered

Create two surfaces given two equations and four unknowns

There ar an infinity of solutions, so the symbolic solution will return no solutions. If you want to experiment with numeric ...

Create two surfaces given two equations and four unknowns

There ar an infinity of solutions, so the symbolic solution will return no solutions. If you want to experiment with numeric ...

16 días ago | 0

Answered

To find the FWHM and area of pulses in a signal waveform

Try this: M = readmatrix('z_data.xlsx'); t = M(:,1); A = M(:,2); As = smoothdata(A, 'movmean',15); ...

To find the FWHM and area of pulses in a signal waveform

Try this: M = readmatrix('z_data.xlsx'); t = M(:,1); A = M(:,2); As = smoothdata(A, 'movmean',15); ...

17 días ago | 0

| accepted

Answered

Unable to perform assignment because the indices on the left side are not compatible with the size of the right side.

The problem is that the first element of ‘Xs’: 4501354550746679/8796093022208 == 0 is not a function of ‘F2’, so it returns a...

Unable to perform assignment because the indices on the left side are not compatible with the size of the right side.

The problem is that the first element of ‘Xs’: 4501354550746679/8796093022208 == 0 is not a function of ‘F2’, so it returns a...

18 días ago | 1

| accepted

Answered

Save an array with multiple rows and columns in .txt file

I would use the writematrix function (R2019a and later). Another option is dlmwrite (and its friends) if you do not have writem...

Save an array with multiple rows and columns in .txt file

I would use the writematrix function (R2019a and later). Another option is dlmwrite (and its friends) if you do not have writem...

18 días ago | 1

| accepted

Answered

How to autosave matlab ode sover results if power goes

I would create a ‘tspan’ vector using linspace, then in a loop, integrate over a portion of the vector, save the results to a .m...

How to autosave matlab ode sover results if power goes

I would create a ‘tspan’ vector using linspace, then in a loop, integrate over a portion of the vector, save the results to a .m...

18 días ago | 0

Answered

Can't plot one-column stacked graph

It is only possible to plot two stacked bars. Hiowever, after that, it is possible to turn one of them off. Try this: figu...

Can't plot one-column stacked graph

It is only possible to plot two stacked bars. Hiowever, after that, it is possible to turn one of them off. Try this: figu...

19 días ago | 0

| accepted

Answered

How to combine two outputs of a into a single vector.

I am not certain what result you want. Try this: L = randi([2,5]); lo = [1,5,10]; hi = [3,8,9]; for k = 1:length(hi) ...

How to combine two outputs of a into a single vector.

I am not certain what result you want. Try this: L = randi([2,5]); lo = [1,5,10]; hi = [3,8,9]; for k = 1:length(hi) ...

19 días ago | 0

| accepted

Answered

Why is this not working

First, it appears that you are trying to solve it inside the functions, and that won’t work. Second, this: F(9) = 0.01*x(6)...

Why is this not working

First, it appears that you are trying to solve it inside the functions, and that won’t work. Second, this: F(9) = 0.01*x(6)...

19 días ago | 1

| accepted

Answered

How do I find my computer's host id?

In Windows, it is the volume serial number for the C:\ drive. To get it, run this from a script or the MATLAB Command Window:...

How do I find my computer's host id?

In Windows, it is the volume serial number for the C:\ drive. To get it, run this from a script or the MATLAB Command Window:...

19 días ago | 0

Answered

Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 0-by-1.

The problem is that vpasolve could not find a solution, so it returned an empty vector. The Symbolic Math Toolbox is good for m...

Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 0-by-1.

The problem is that vpasolve could not find a solution, so it returned an empty vector. The Symbolic Math Toolbox is good for m...

19 días ago | 0

Answered

For loop overwrites values in signal

First, please do not use ‘max’ as a variable name. It is the name of the max function (obviously) and variable names take prece...

For loop overwrites values in signal

First, please do not use ‘max’ as a variable name. It is the name of the max function (obviously) and variable names take prece...

19 días ago | 0

| accepted

Answered

how to create equation x y z using matlab

If you simply want to plot them: x = [5.252907987, 1.945397314, 1.016, 0.243]; y = [287.4171875, 137.4367188, 80.08359375, 37...

how to create equation x y z using matlab

If you simply want to plot them: x = [5.252907987, 1.945397314, 1.016, 0.243]; y = [287.4171875, 137.4367188, 80.08359375, 37...

19 días ago | 0

| accepted

Answered

how to find the values of x,y, z,t

Try this (after adding the necesary multiplication operators): syms t x y z F = [0.542294 + 1.2144*x + 1.025*y + 0.0666*x^2...

how to find the values of x,y, z,t

Try this (after adding the necesary multiplication operators): syms t x y z F = [0.542294 + 1.2144*x + 1.025*y + 0.0666*x^2...

19 días ago | 0

Answered

TRANSER FUNCTION OF RC CIRCUIT WITH GIVEN VALUES

I would use a for loop to change the component values and plot them. The instructions say to use the same set of axes (use the ...

TRANSER FUNCTION OF RC CIRCUIT WITH GIVEN VALUES

I would use a for loop to change the component values and plot them. The instructions say to use the same set of axes (use the ...

19 días ago | 0

Answered

Input argument in a function as a string?

It’s a bit more involved than that. The axis labels and the title are Axes Properties, not Line properties, so: ax.XLabel.S...

Input argument in a function as a string?

It’s a bit more involved than that. The axis labels and the title are Axes Properties, not Line properties, so: ax.XLabel.S...

20 días ago | 0

| accepted

Answered

How to convert accelerometer data from excel into frequency

The sampling frequency is too low to detect a 130 Hz vibration: A = readmatrix('DutyCylce82Vals2.csv'); A(:,1) = A(:,1)*1E-3;...

How to convert accelerometer data from excel into frequency

The sampling frequency is too low to detect a 130 Hz vibration: A = readmatrix('DutyCylce82Vals2.csv'); A(:,1) = A(:,1)*1E-3;...

20 días ago | 0

| accepted

Answered

Read CSV with row in quotes (string and numbers)

‘I have no idea to read the .CSV file correctly.’ One approach: C = {"7129300520,""20141013T000000"",221900,3,1,1180,5650,"...

Read CSV with row in quotes (string and numbers)

‘I have no idea to read the .CSV file correctly.’ One approach: C = {"7129300520,""20141013T000000"",221900,3,1,1180,5650,"...

20 días ago | 0

| accepted

Answered

What factors I need to consider when transferring to new version of Maltab?

The 2020a is pre-release, so you cannot discuss any details of it here. For all the others (including 2020a when it is releas...

What factors I need to consider when transferring to new version of Maltab?

The 2020a is pre-release, so you cannot discuss any details of it here. For all the others (including 2020a when it is releas...

20 días ago | 1

Answered

Create function handle from function file

Yes! In some instances, that is necessary in order to evaluate the function. Example — function y = f(x) y ...

Create function handle from function file

Yes! In some instances, that is necessary in order to evaluate the function. Example — function y = f(x) y ...

20 días ago | 0

| accepted

Answered

function variables not saved to workspace

Call the function as: [x,y]=myfunc() and both should be in your workspace.

function variables not saved to workspace

Call the function as: [x,y]=myfunc() and both should be in your workspace.

20 días ago | 0

| accepted