3.104 total contributions since 2018

Communication through MATLAB is always better than arguing.

Answered

Wrong output when using random numbers

./ % this is why? see Array vs. Matlab operations [Google it]

Wrong output when using random numbers

./ % this is why? see Array vs. Matlab operations [Google it]

etwa 9 Stunden ago | 1

| accepted

Answered

Leave out dot notation in table variables

I don’t know why it’s hard for you to use "D." , see <https://in.mathworks.com/help/matlab/matlab_prog/access-data-in-a-table.ht...

Leave out dot notation in table variables

I don’t know why it’s hard for you to use "D." , see <https://in.mathworks.com/help/matlab/matlab_prog/access-data-in-a-table.ht...

etwa 16 Stunden ago | 0

Answered

how do you get the max y value in an fplot?

h = fplot(...); MAX = max(h.YData)

how do you get the max y value in an fplot?

h = fplot(...); MAX = max(h.YData)

2 Tage ago | 0

Answered

How to find position of array

Simpler without any conversions: s=[1 0 1 1 0 0 0 0 1 1 1 1]; % example data x=s~=0; Start = strfind([0,x],[0 1]) End = strf...

How to find position of array

Simpler without any conversions: s=[1 0 1 1 0 0 0 0 1 1 1 1]; % example data x=s~=0; Start = strfind([0,x],[0 1]) End = strf...

3 Tage ago | 1

Answered

Unable to perform assignment because the left and right sides have a different number of elements.

No loops needed: syms sy F d g2 lsf=(g2==sy*((pi*d^2)/4)-F); mem=[61000,60000,1.5]; std=[5200,15000,0.021]; n=3...

Unable to perform assignment because the left and right sides have a different number of elements.

No loops needed: syms sy F d g2 lsf=(g2==sy*((pi*d^2)/4)-F); mem=[61000,60000,1.5]; std=[5200,15000,0.021]; n=3...

5 Tage ago | 0

Answered

Subscript indices must either be real positive integers or logicals.

clear all % and try again

Subscript indices must either be real positive integers or logicals.

clear all % and try again

5 Tage ago | 1

Answered

Check if any elements of cell array are equal ?

This method works for cells with contents of any sizes: a{1}=[1 1 0]; % example array a{2}=[0 10]; a{3}=[1 1 0]; Result = fa...

Check if any elements of cell array are equal ?

This method works for cells with contents of any sizes: a{1}=[1 1 0]; % example array a{2}=[0 10]; a{3}=[1 1 0]; Result = fa...

6 Tage ago | 3

Answered

Code for Multiple Matrix Multiplication

RR = cell(1,size(T,3)-1); % where T is your 3D matrix RR{1} = T(:,:,1)*T(:,:,2); for k = 2:size(T,3)-1 RR{k} = RR{k-1} * ...

Code for Multiple Matrix Multiplication

RR = cell(1,size(T,3)-1); % where T is your 3D matrix RR{1} = T(:,:,1)*T(:,:,2); for k = 2:size(T,3)-1 RR{k} = RR{k-1} * ...

6 Tage ago | 0

Answered

How to extract number from cell array?

cellfun(@(x) sscanf(x,'Interval: %f'),c,'un',0) % assuming follows the same pattern , turn 0 to 1 if it’s a scalar output.

How to extract number from cell array?

cellfun(@(x) sscanf(x,'Interval: %f'),c,'un',0) % assuming follows the same pattern , turn 0 to 1 if it’s a scalar output.

6 Tage ago | 0

Answered

Plotting graphs while solving Multiple Differential Equations using ODE45

Looks like you need to parameterize your function ( lookup doc )while you vary Wi parameter. Loop through Wi and plot the soluti...

Plotting graphs while solving Multiple Differential Equations using ODE45

Looks like you need to parameterize your function ( lookup doc )while you vary Wi parameter. Loop through Wi and plot the soluti...

7 Tage ago | 0

| accepted

Answered

how to combine the coordinates of points of 2 column vectors for specific width

matrix(1,:) % extracted the first coordinate , however I don’t know what you mean by label them as five perhaps text() is what...

how to combine the coordinates of points of 2 column vectors for specific width

matrix(1,:) % extracted the first coordinate , however I don’t know what you mean by label them as five perhaps text() is what...

7 Tage ago | 0

Answered

How to create a matrix of Matlab Functions out of a symbolic matrix?

<https://in.mathworks.com/matlabcentral/answers/466543-how-to-create-a-matrix-of-matlab-functions-out-of-a-symbolic-matrix#comme...

How to create a matrix of Matlab Functions out of a symbolic matrix?

<https://in.mathworks.com/matlabcentral/answers/466543-how-to-create-a-matrix-of-matlab-functions-out-of-a-symbolic-matrix#comme...

8 Tage ago | 1

| accepted

Answered

Removing NaN values in Structure

modelo2 = modelo.Val(~isnan(modelo.Val));

Removing NaN values in Structure

modelo2 = modelo.Val(~isnan(modelo.Val));

8 Tage ago | 0

| accepted

Answered

How to make matlab count

"Is there a way for Matlab to count how many of each number has occured." The below gives the number of counts of each unique e...

How to make matlab count

"Is there a way for Matlab to count how many of each number has occured." The below gives the number of counts of each unique e...

8 Tage ago | 0

| accepted

Answered

Matlab: Matrix with negative numbers

No loops needed: matrix(matrix <0) = 0;

Matlab: Matrix with negative numbers

No loops needed: matrix(matrix <0) = 0;

9 Tage ago | 1

Answered

change last element in array by specific value matlab

Result = a; if Result(end) == specific_value % specific value is 9 for example Result(end) = 1; end

change last element in array by specific value matlab

Result = a; if Result(end) == specific_value % specific value is 9 for example Result(end) = 1; end

12 Tage ago | 0

| accepted

Answered

How to obtain the minimum values of an array?

Have a look at *mink()* else use *sort()* and pick the first four values if you’re using older version.

How to obtain the minimum values of an array?

Have a look at *mink()* else use *sort()* and pick the first four values if you’re using older version.

12 Tage ago | 1

| accepted

Answered

how does a diff operation works for relational and logical cases with arrays ?

A = [14 5 6 14 32]==14 % Split it into two lines diff(A)

how does a diff operation works for relational and logical cases with arrays ?

A = [14 5 6 14 32]==14 % Split it into two lines diff(A)

12 Tage ago | 0

Answered

What is an elegant way to pack and unpack an array of structures to/from a single vector?

z = struct2cell(data); x = [z{:}] data = cell2struct(z,{'r','v','m'}) % reverse

What is an elegant way to pack and unpack an array of structures to/from a single vector?

z = struct2cell(data); x = [z{:}] data = cell2struct(z,{'r','v','m'}) % reverse

13 Tage ago | 0

Answered

Selection of Matrix Elements without for loop

B(sub2ind(size(B),A(:,1),A(:,2)))

Selection of Matrix Elements without for loop

B(sub2ind(size(B),A(:,1),A(:,2)))

15 Tage ago | 1

| accepted

Answered

2D matrix to 3D

repmat(a,1,1,max(a(:))) % where a is your matrix if you have decimals in your matrix then use round function for max() to make...

2D matrix to 3D

repmat(a,1,1,max(a(:))) % where a is your matrix if you have decimals in your matrix then use round function for max() to make...

15 Tage ago | 0

Answered

how to sort 2 columns values based on one column

[~,idx]=sort(matrix); matrix(idx,:) % first column sorted in ascending order if vice versa use 'descend' option

how to sort 2 columns values based on one column

[~,idx]=sort(matrix); matrix(idx,:) % first column sorted in ascending order if vice versa use 'descend' option

15 Tage ago | 1

| accepted

Answered

How do rewrite a variable with the symbolic toolbox?

syms a b eq=a==b+3 isolate(eq,b) %or b=solve(eq,b)

How do rewrite a variable with the symbolic toolbox?

syms a b eq=a==b+3 isolate(eq,b) %or b=solve(eq,b)

16 Tage ago | 0

| accepted

Answered

how i can store array of string for every loop

<https://in.mathworks.com/help/matlab/import_export/process-a-sequence-of-files.html>

how i can store array of string for every loop

<https://in.mathworks.com/help/matlab/import_export/process-a-sequence-of-files.html>

16 Tage ago | 0

Answered

Creating vectors from rows of matrix

Subvectors = reshape(V,1,b,[])

Creating vectors from rows of matrix

Subvectors = reshape(V,1,b,[])

16 Tage ago | 0

| accepted

Answered

how to recognize if column is greater or row????????

if output(1) > output(2) disp('Row is greater than column') elseif output(1) < output(2) disp(' Column is great...

how to recognize if column is greater or row????????

if output(1) > output(2) disp('Row is greater than column') elseif output(1) < output(2) disp(' Column is great...

16 Tage ago | 0