Answered

convert smaller number to large number in matlab

If you want to change the default display style in command window then run this line format long G and then display the number...

convert smaller number to large number in matlab

If you want to change the default display style in command window then run this line format long G and then display the number...

1 year ago | 2

Answered

how to change some parameter of a m-file from command window

.m file is a text file, so you can use all the functions to manipulate text files; for example, check the list of the function h...

how to change some parameter of a m-file from command window

.m file is a text file, so you can use all the functions to manipulate text files; for example, check the list of the function h...

1 year ago | 0

Answered

Adding zeros at the end of arrays in a loop

Finally, you have encountered the problem of naming variables like var1, var2, var3, ... This thread has a detailed discussion o...

Adding zeros at the end of arrays in a loop

Finally, you have encountered the problem of naming variables like var1, var2, var3, ... This thread has a detailed discussion o...

1 year ago | 0

Answered

how to creat an algorithm to inverse matrix

There are several algorithms for calculation of matrix inverse: https://en.wikipedia.org/wiki/Invertible_matrix#Methods_of_matri...

how to creat an algorithm to inverse matrix

There are several algorithms for calculation of matrix inverse: https://en.wikipedia.org/wiki/Invertible_matrix#Methods_of_matri...

1 year ago | 1

Answered

3D hypercube to 2D array

No, If you want to read the elements left to right then first you need to permute the 1st and 2nd dimensions A; % 250x250x150 ...

3D hypercube to 2D array

No, If you want to read the elements left to right then first you need to permute the 1st and 2nd dimensions A; % 250x250x150 ...

1 year ago | 0

| accepted

Answered

create a matrix from a text file

Try sub2ind(): https://www.mathworks.com/help/matlab/ref/sub2ind.html to convert from row and column number to a linear index. S...

create a matrix from a text file

Try sub2ind(): https://www.mathworks.com/help/matlab/ref/sub2ind.html to convert from row and column number to a linear index. S...

1 year ago | 0

| accepted

Answered

finding point on a function

You can use polyval() xv; % x data-points yv; % y data-points p = polyfit(xv, yv, 3); x = a; y = polyval(p, x);

finding point on a function

You can use polyval() xv; % x data-points yv; % y data-points p = polyfit(xv, yv, 3); x = a; y = polyval(p, x);

1 year ago | 1

Answered

how to plot given exponential fn?

Several ways: mesh(), surf(), contoruf(), contour(), pcolor(), imagesc() [X, Y] = meshgrid(linspace(-1, 1, 50)); Z = exp(X.^2+...

how to plot given exponential fn?

Several ways: mesh(), surf(), contoruf(), contour(), pcolor(), imagesc() [X, Y] = meshgrid(linspace(-1, 1, 50)); Z = exp(X.^2+...

1 year ago | 1

Answered

Gaussian distribution with sum 1

What about M = randn(10); M_sum1 = M./sum(M, 'all'); Check: >> sum(M_sum1, 'all') ans = 1

Gaussian distribution with sum 1

What about M = randn(10); M_sum1 = M./sum(M, 'all'); Check: >> sum(M_sum1, 'all') ans = 1

1 year ago | 0

Answered

Graph an exponential equation

You can use fsolve() for such problems. For example fun = @(x) exp(-0.005*x).*cos(0.05*(2000-0.01*x.^2).^(0.05))-0.01 sol = fs...

Graph an exponential equation

You can use fsolve() for such problems. For example fun = @(x) exp(-0.005*x).*cos(0.05*(2000-0.01*x.^2).^(0.05))-0.01 sol = fs...

1 year ago | 0

| accepted

Answered

Finding angles with optimizaiton

You need at least two equations to find a unique solution. For a single equation, fix the value of one of these variables theta...

Finding angles with optimizaiton

You need at least two equations to find a unique solution. For a single equation, fix the value of one of these variables theta...

1 year ago | 0

Answered

mean value of array after every n columns

Here is a loop-free option a = matfile('x'); b=a.dataPower; %dataPower array bround=round(b(1:131072)); k = mean(reshape(bro...

mean value of array after every n columns

Here is a loop-free option a = matfile('x'); b=a.dataPower; %dataPower array bround=round(b(1:131072)); k = mean(reshape(bro...

1 year ago | 0

| accepted

Answered

Whats the difference when using [ ] and : ?

reshape() work by taking the elements of the input matrix column-wise and arrange them into the shape you want. For example, hel...

Whats the difference when using [ ] and : ?

reshape() work by taking the elements of the input matrix column-wise and arrange them into the shape you want. For example, hel...

1 year ago | 1

Answered

Function XXXX not supported for code generation.

By default, Simulink converts the whole model to C code. If you are using this inside a MATLAB function block, you can use coder...

Function XXXX not supported for code generation.

By default, Simulink converts the whole model to C code. If you are using this inside a MATLAB function block, you can use coder...

1 year ago | 1

| accepted

Answered

imwrite saving image incorrectly

Does your png image have transparent components? Try saving with the alpha channel. [file, path] = uiputfile('.png'); [image, ...

imwrite saving image incorrectly

Does your png image have transparent components? Try saving with the alpha channel. [file, path] = uiputfile('.png'); [image, ...

1 year ago | 0

Answered

Transfer function with 2 inputs and 2 outputs

Study this code syms x(t) v(t) I(t) F(t) s v(t) = diff(x, t); eq = diff(v) == (562/101)*x+(6744/101)*I+(1/50500)*F; lap = ...

Transfer function with 2 inputs and 2 outputs

Study this code syms x(t) v(t) I(t) F(t) s v(t) = diff(x, t); eq = diff(v) == (562/101)*x+(6744/101)*I+(1/50500)*F; lap = ...

1 year ago | 0

| accepted

Answered

Structs Help on indexing

Try something like this city_name = 'Abidjan'; idx = contains({climate.info.name}, city_name); city_data = climate.info(idx)

Structs Help on indexing

Try something like this city_name = 'Abidjan'; idx = contains({climate.info.name}, city_name); city_data = climate.info(idx)

1 year ago | 0

Answered

Is there an other commande in previous matlab version which remplace the commande "serialportlist" ?

Previously there were instrfind() and instrfindall().

Is there an other commande in previous matlab version which remplace the commande "serialportlist" ?

Previously there were instrfind() and instrfindall().

1 year ago | 0

| accepted

Answered

How to take a difference within the data of the same city but not across the city, Part 3

Same answer as this: https://www.mathworks.com/matlabcentral/answers/685423-how-to-take-a-difference-within-the-data-of-the-same...

How to take a difference within the data of the same city but not across the city, Part 3

Same answer as this: https://www.mathworks.com/matlabcentral/answers/685423-how-to-take-a-difference-within-the-data-of-the-same...

1 year ago | 0

| accepted

Answered

How to take a difference within the data of the same city but not across the city, Part 2

Same answer as this: https://www.mathworks.com/matlabcentral/answers/685423-how-to-take-a-difference-within-the-data-of-the-same...

How to take a difference within the data of the same city but not across the city, Part 2

Same answer as this: https://www.mathworks.com/matlabcentral/answers/685423-how-to-take-a-difference-within-the-data-of-the-same...

1 year ago | 0

| accepted

Answered

How to take a difference within the data of the same city but not across the city

Try this T = readtable('test.xlsx'); New_Visitors = splitapply(@(x) {[x(1); diff(x)]}, T.Cumulative_visitors, findgroups(T.Cit...

How to take a difference within the data of the same city but not across the city

Try this T = readtable('test.xlsx'); New_Visitors = splitapply(@(x) {[x(1); diff(x)]}, T.Cumulative_visitors, findgroups(T.Cit...

1 year ago | 0

| accepted

Answered

Unable to convert expression into double array

It seems that some terms in your integral cannot be solved symbolically therefore MATLAB throws this error. You can try to calcu...

Unable to convert expression into double array

It seems that some terms in your integral cannot be solved symbolically therefore MATLAB throws this error. You can try to calcu...

1 year ago | 1

| accepted

Answered

Intersection of a row and column from a matrix

Are you looking for this? p=[1 2 3;4 1 2;2 8 1]; x = input('x? '); y = input('x? '); P = p(y,x)

Intersection of a row and column from a matrix

Are you looking for this? p=[1 2 3;4 1 2;2 8 1]; x = input('x? '); y = input('x? '); P = p(y,x)

1 year ago | 0

| accepted

Answered

Combine the results of each iteration into an array

Use fprintf() a=1;b=2;c=3; for t=[a b c] fprintf('%d ', t) end fprintf(newline)

Combine the results of each iteration into an array

Use fprintf() a=1;b=2;c=3; for t=[a b c] fprintf('%d ', t) end fprintf(newline)

1 year ago | 0

Answered

4byte uint8 array to single uint32 value

You can use typecast() myArray = [0x32 0x45 0x56 0x81]; out = swapbytes(typecast(myArray, 'uint32')); % swapbytes is needed on...

4byte uint8 array to single uint32 value

You can use typecast() myArray = [0x32 0x45 0x56 0x81]; out = swapbytes(typecast(myArray, 'uint32')); % swapbytes is needed on...

1 year ago | 4

| accepted

Answered

Applying a function across all columns of a table

See varfun(): https://www.mathworks.com/help/matlab/ref/varfun.html. Convert your code into a function like this function y =...

Applying a function across all columns of a table

See varfun(): https://www.mathworks.com/help/matlab/ref/varfun.html. Convert your code into a function like this function y =...

1 year ago | 0

Answered

How to export a matrix of numeric values to Excel using writematrix

The documentation mentions that the newer functions have better cross-platform support and performance as compared to xlswrite. ...

How to export a matrix of numeric values to Excel using writematrix

The documentation mentions that the newer functions have better cross-platform support and performance as compared to xlswrite. ...

1 year ago | 0

| accepted

Answered

How can I find coordinates via matlab command?

It appears that there is no built-in function. You will need to use the API of an external service, e.g., google map, to get thi...

How can I find coordinates via matlab command?

It appears that there is no built-in function. You will need to use the API of an external service, e.g., google map, to get thi...

1 year ago | 0

Answered

How do I index an entire row given a randomised value?

You can use logical indexing El_mat = [...., 34 0.214 0.236 0.588, 35 0.259 0.336 0.114,....] n = 34...

How do I index an entire row given a randomised value?

You can use logical indexing El_mat = [...., 34 0.214 0.236 0.588, 35 0.259 0.336 0.114,....] n = 34...

1 year ago | 0

| accepted

Answered

How to upload a .mat file into Amazon s3

You can use API to write the data: https://www.mathworks.com/help/matlab/ref/webwrite.html, but that can get complicated for AWS...

How to upload a .mat file into Amazon s3

You can use API to write the data: https://www.mathworks.com/help/matlab/ref/webwrite.html, but that can get complicated for AWS...

1 year ago | 0

| accepted