Answered

Generate a 100000x100000 matrix that takes less time and memory

If most of the elements equal to zero, then use sparse array: https://www.mathworks.com/help/matlab/ref/sparse.html. You can als...

Generate a 100000x100000 matrix that takes less time and memory

If most of the elements equal to zero, then use sparse array: https://www.mathworks.com/help/matlab/ref/sparse.html. You can als...

11 hours ago | 2

Answered

Problem in exporting vector with Matlab R2016a

xlswrite is used for writing to MS Excel files. Use dlmwrite() dlmwrite('vector.txt', x')

Problem in exporting vector with Matlab R2016a

xlswrite is used for writing to MS Excel files. Use dlmwrite() dlmwrite('vector.txt', x')

12 hours ago | 0

Answered

Assign values of .mat files into matrix

One of the major problem is naming the variables like this x1, x2, ...: https://www.mathworks.com/matlabcentral/answers/304528-t...

Assign values of .mat files into matrix

One of the major problem is naming the variables like this x1, x2, ...: https://www.mathworks.com/matlabcentral/answers/304528-t...

12 hours ago | 0

Answered

How can I have two different scales within the same axis on a plot ?

Refer to my answer here: https://www.mathworks.com/matlabcentral/answers/601147-extending-specific-y-axis-values.

How can I have two different scales within the same axis on a plot ?

Refer to my answer here: https://www.mathworks.com/matlabcentral/answers/601147-extending-specific-y-axis-values.

12 hours ago | 0

Answered

Creating a timeseries using number of rows

Try something like this t1 = datetime('04-Jan-2015 00:00', 'Format', 'dd-MM-yyyy HH:mm'); t2 = datetime('07-Jan-2015 00:00', '...

Creating a timeseries using number of rows

Try something like this t1 = datetime('04-Jan-2015 00:00', 'Format', 'dd-MM-yyyy HH:mm'); t2 = datetime('07-Jan-2015 00:00', '...

12 hours ago | 0

Answered

How to compare two variables data by using ifelse? if both variable contain same number and length of data, so condition becomes true it should perform desired functionality.

data and a,b,c,d have different dimensions. Use isequal() if isequal(data, a) value =1 elseif isequal(data, b) value...

How to compare two variables data by using ifelse? if both variable contain same number and length of data, so condition becomes true it should perform desired functionality.

data and a,b,c,d have different dimensions. Use isequal() if isequal(data, a) value =1 elseif isequal(data, b) value...

12 hours ago | 1

Answered

Graphing a nonlinear 2nd order differential equation?

See ode45(): https://www.mathworks.com/help/matlab/ref/ode45.html espically the example titled "Solve Nonstiff Equation". IC = ...

Graphing a nonlinear 2nd order differential equation?

See ode45(): https://www.mathworks.com/help/matlab/ref/ode45.html espically the example titled "Solve Nonstiff Equation". IC = ...

12 hours ago | 1

Answered

why it showing ((Warning: Image is too big to fit on screen; displaying at 67% )) ?

This means that your image has more pixels, then your screen can fit. This is not an error, just a warning. You can suppress it ...

why it showing ((Warning: Image is too big to fit on screen; displaying at 67% )) ?

This means that your image has more pixels, then your screen can fit. This is not an error, just a warning. You can suppress it ...

13 hours ago | 0

Answered

Removing rows in a matrix

Try this n = size(Identify_3); idx = (mod((1:n)-1, 6)+1) <= 2; Identify_3 = Identify_3(idx, :);

Removing rows in a matrix

Try this n = size(Identify_3); idx = (mod((1:n)-1, 6)+1) <= 2; Identify_3 = Identify_3(idx, :);

13 hours ago | 0

| accepted

Answered

Solve the system of equations by putting them in matrix form for the unkown voltages v1-v4

Read about linsolve(): https://www.mathworks.com/help/matlab/ref/linsolve.html or ldivide: https://www.mathworks.com/help/matlab...

Solve the system of equations by putting them in matrix form for the unkown voltages v1-v4

Read about linsolve(): https://www.mathworks.com/help/matlab/ref/linsolve.html or ldivide: https://www.mathworks.com/help/matlab...

13 hours ago | 0

Answered

How do i read binary file

Try this fileID = fopen('test.bin'); precision = '1*uint8'; fseek(fileID, 8, 0); % skip 8 bytes B = fread(fileID,[1,7],preci...

How do i read binary file

Try this fileID = fopen('test.bin'); precision = '1*uint8'; fseek(fileID, 8, 0); % skip 8 bytes B = fread(fileID,[1,7],preci...

13 hours ago | 0

| accepted

Answered

How to remove spaces from a string using while if or for/

It is important that you traverse the string from the end toward the beginning. c = 'that is some tick stuf f f'; l = numel(c)...

How to remove spaces from a string using while if or for/

It is important that you traverse the string from the end toward the beginning. c = 'that is some tick stuf f f'; l = numel(c)...

14 hours ago | 1

| accepted

Answered

How to replace elements in a matrix using logical

Try this X = [ 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4]; tf = ...

How to replace elements in a matrix using logical

Try this X = [ 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4]; tf = ...

14 hours ago | 0

Answered

Solve an equation, answer not solved

It is giving you symbolic solution. You are probably looking for a numeric solution. Use vpa() or double() syms deltax eqn = -...

Solve an equation, answer not solved

It is giving you symbolic solution. You are probably looking for a numeric solution. Use vpa() or double() syms deltax eqn = -...

14 hours ago | 0

| accepted

Answered

hope the plotting graph

Try this x = linspace(20,100000); y = 20*log(1./(1+(2*(3.14)*(x)*(102*10^-9)*(985.1)).^2).^0.5); plot(x,y) Read about eleme...

hope the plotting graph

Try this x = linspace(20,100000); y = 20*log(1./(1+(2*(3.14)*(x)*(102*10^-9)*(985.1)).^2).^0.5); plot(x,y) Read about eleme...

14 hours ago | 0

Answered

computation on each column in matrix - projecting the Matrix onto a plane

Try this p0 = [0; 0; 0]; %the point in my new plane, the one I am gonna project onto N = [1,2,3].'; %Normal to the plane which...

computation on each column in matrix - projecting the Matrix onto a plane

Try this p0 = [0; 0; 0]; %the point in my new plane, the one I am gonna project onto N = [1,2,3].'; %Normal to the plane which...

14 hours ago | 0

Answered

how can i calculate a complex polygon with coordinates in matlab ?

The equation in your comment can be written in MATLAB like this A = 1/2*sum(x(1:end-1).*y(2:end)-y(1:end-1).*x(2:end));

how can i calculate a complex polygon with coordinates in matlab ?

The equation in your comment can be written in MATLAB like this A = 1/2*sum(x(1:end-1).*y(2:end)-y(1:end-1).*x(2:end));

14 hours ago | 0

| accepted

Answered

Solve system of nonlinear equations with matlab

One way is to use fsolve() from optimization toolbox fun = @(x, y) [-2*x.^2+3*x.*y+4*sin(y)-6; ... 3*x.^2-2*x.*y.^2+3*cos(...

Solve system of nonlinear equations with matlab

One way is to use fsolve() from optimization toolbox fun = @(x, y) [-2*x.^2+3*x.*y+4*sin(y)-6; ... 3*x.^2-2*x.*y.^2+3*cos(...

15 hours ago | 0

Answered

Unable to find explicit solution

This warning message shows that MATLAB is not able to find an analytical solution for your equation. You need to substitute the ...

Unable to find explicit solution

This warning message shows that MATLAB is not able to find an analytical solution for your equation. You need to substitute the ...

16 hours ago | 0

Answered

I need a help on making the number calculation into matrix calculation

Read about array indexing in MATLAB: https://www.mathworks.com/company/newsletters/articles/matrix-indexing-in-matlab.html clc...

I need a help on making the number calculation into matrix calculation

Read about array indexing in MATLAB: https://www.mathworks.com/company/newsletters/articles/matrix-indexing-in-matlab.html clc...

17 hours ago | 0

Answered

Zero phase filter using specific filter coefficients

Read about filtfilt(): https://www.mathworks.com/help/signal/ref/filtfilt.html from signal processing toolbox.

Zero phase filter using specific filter coefficients

Read about filtfilt(): https://www.mathworks.com/help/signal/ref/filtfilt.html from signal processing toolbox.

17 hours ago | 0

Answered

Loop with different outcome name

Creating variable names like y1, y2, ... is not a good coding practice and highly non-recommended: https://www.mathworks.com/mat...

Loop with different outcome name

Creating variable names like y1, y2, ... is not a good coding practice and highly non-recommended: https://www.mathworks.com/mat...

17 hours ago | 0

Answered

how to put them text lines into loop to reduce the coding line?

Try this yv = [0.038 0.028 0.02 0.013 0.0076 0.004 0.0015 0]; hold on for i = 1:numel(yv) text(1.688, yv(i), sprintf('ol...

how to put them text lines into loop to reduce the coding line?

Try this yv = [0.038 0.028 0.02 0.013 0.0076 0.004 0.0015 0]; hold on for i = 1:numel(yv) text(1.688, yv(i), sprintf('ol...

17 hours ago | 0

Answered

How to find optimum parameters for a NARX model

You can use the nlarx function(): https://www.mathworks.com/help/ident/ref/nlarx.html to progammatically estimate the parameters...

How to find optimum parameters for a NARX model

You can use the nlarx function(): https://www.mathworks.com/help/ident/ref/nlarx.html to progammatically estimate the parameters...

17 hours ago | 0

Answered

Interpolation of data at each specific value in the variable

See interp1(): https://www.mathworks.com/help/matlab/ref/interp1.html. You can probably do something like this distance; % your...

Interpolation of data at each specific value in the variable

See interp1(): https://www.mathworks.com/help/matlab/ref/interp1.html. You can probably do something like this distance; % your...

19 hours ago | 0

Answered

Change colorbar title position latex

Try something like this c = colorbar; c.Title.String = '$\omega(1/s)$'; c.Title.Interpreter = 'latex'; c.Title.FontSize = 16...

Change colorbar title position latex

Try something like this c = colorbar; c.Title.String = '$\omega(1/s)$'; c.Title.Interpreter = 'latex'; c.Title.FontSize = 16...

19 hours ago | 0

| accepted

Answered

Does Any one know what am I doing here and what is the solution for it?

This y(i)(1:10:end,:) is not a valid MATLAB syntax. Just use y(i) text(x(i), y(i), 'Width=0.7m', ...

Does Any one know what am I doing here and what is the solution for it?

This y(i)(1:10:end,:) is not a valid MATLAB syntax. Just use y(i) text(x(i), y(i), 'Width=0.7m', ...

19 hours ago | 0

Answered

hello, could you tell me if the Russian university MAI has a student license, and if so, how to get it

If the university has a campus-wide license, you can find it here: https://www.mathworks.com/academia/tah-support-program/eligib...

hello, could you tell me if the Russian university MAI has a student license, and if so, how to get it

If the university has a campus-wide license, you can find it here: https://www.mathworks.com/academia/tah-support-program/eligib...

19 hours ago | 0

Answered

Linking sections of live script

Once the variable is defined, it is visible to all sections of the Live script. There is no special procedure to access it; you ...

Linking sections of live script

Once the variable is defined, it is visible to all sections of the Live script. There is no special procedure to access it; you ...

19 hours ago | 0

Answered

Cannot see any output in live editor + send editable live script

How are you downloading the file? You need to press this button to download Also, to display the output of a line in the live...

Cannot see any output in live editor + send editable live script

How are you downloading the file? You need to press this button to download Also, to display the output of a line in the live...

22 hours ago | 0