3 418 total contributions since 2018

Communication through MATLAB is always better than arguing.

Answered

logical array variables in a loop

It would been simpler if they were stored in a cell array: c{1} = outlier & incl_p; c{2}= outlier & incl_r; c{3} = ou...

logical array variables in a loop

It would been simpler if they were stored in a cell array: c{1} = outlier & incl_p; c{2}= outlier & incl_r; c{3} = ou...

environ 12 heures ago | 1

| accepted

Answered

How can i get sub matrices with using for loop

a=arrayfun(@(x)A(A==unique(x)),A,'un',0) celldisp(a) If you’re goal is simply to create A with repetitions of 10 then it...

How can i get sub matrices with using for loop

a=arrayfun(@(x)A(A==unique(x)),A,'un',0) celldisp(a) If you’re goal is simply to create A with repetitions of 10 then it...

environ 16 heures ago | 0

Answered

How can I plot a sin (x^2) function

fplot(@(x)sin(x.^2),[-pi,pi])

How can I plot a sin (x^2) function

fplot(@(x)sin(x.^2),[-pi,pi])

environ 16 heures ago | 1

Answered

How to count the number of repeat elements in a matrix

M =["Fa" "Fa" "Fa" "Fa" "Ka" "Ka"]; [~,~,c] = unique(M); A = accumarray(c,1)

How to count the number of repeat elements in a matrix

M =["Fa" "Fa" "Fa" "Fa" "Ka" "Ka"]; [~,~,c] = unique(M); A = accumarray(c,1)

1 jour ago | 0

Answered

Create a matrix from a vector

A = ismember(M,V) .* M % Note: 14 should be in 1,1 not 2,1

Create a matrix from a vector

A = ismember(M,V) .* M % Note: 14 should be in 1,1 not 2,1

1 jour ago | 0

| accepted

Answered

Creating a table for publishing for the matrix I defined

TABle = table(T(:),C_vv(:),'VariableNames',{'Temperature','Heat'}) % I don’t know what you mean by naming columns isn’t that V...

Creating a table for publishing for the matrix I defined

TABle = table(T(:),C_vv(:),'VariableNames',{'Temperature','Heat'}) % I don’t know what you mean by naming columns isn’t that V...

1 jour ago | 0

| accepted

Answered

How to use a nested loop to do a matrix calculation?

x = [1 2 3 4; 5 6 7 8; 9 10 11 12; 13 14 15 16] y = [16 15 14 13; 13 14 15 16; 17 18 19 20; 21 22 22 23] v = zeros(k,l)...

How to use a nested loop to do a matrix calculation?

x = [1 2 3 4; 5 6 7 8; 9 10 11 12; 13 14 15 16] y = [16 15 14 13; 13 14 15 16; 17 18 19 20; 21 22 22 23] v = zeros(k,l)...

1 jour ago | 0

Answered

How can I add a matrix into another matrix

A = [A;B] help fprintf doc fprintf

How can I add a matrix into another matrix

A = [A;B] help fprintf doc fprintf

2 jours ago | 0

Answered

Preallocated array A using a for loop

https://in.mathworks.com/help/matlab/matlab_prog/preallocating-arrays.html - you will see how to store values in each iteration...

Preallocated array A using a for loop

https://in.mathworks.com/help/matlab/matlab_prog/preallocating-arrays.html - you will see how to store values in each iteration...

2 jours ago | 2

Answered

How do i find the x value for a GIVEN x

fsolve(@(x)f(x)-.25,[0,10]) % two solutions but look into you're area of interest fplot(@(x)f(x)-.25,[0,11])

How do i find the x value for a GIVEN x

fsolve(@(x)f(x)-.25,[0,10]) % two solutions but look into you're area of interest fplot(@(x)f(x)-.25,[0,11])

2 jours ago | 0

Answered

How to select the values greater than the mean in an array?

B1(B1>mean(B1(:)))

How to select the values greater than the mean in an array?

B1(B1>mean(B1(:)))

2 jours ago | 1

| accepted

Answered

Error using ^ inputs

.* .^ <https://in.mathworks.com/help/matlab/matlab_prog/array-vs-matrix-operations.html>

Error using ^ inputs

.* .^ <https://in.mathworks.com/help/matlab/matlab_prog/array-vs-matrix-operations.html>

2 jours ago | 0

Answered

How to assign vectors to existing vector

newvector_2=vector_2; ix=nnz(~vector_2); v12=[vector_1,nonzeros(vector_2).']; u=unique(v12); d=setdiff(1:max(v12),v12); new...

How to assign vectors to existing vector

newvector_2=vector_2; ix=nnz(~vector_2); v12=[vector_1,nonzeros(vector_2).']; u=unique(v12); d=setdiff(1:max(v12),v12); new...

2 jours ago | 0

Answered

How to add two values to a matrix each five values of that matrix in order to have a new matrix?

ix=arrayfun(@(x)[x,x*(ones(~mod(x,5),2))],1:numel(XY),'un',0); % multiple of 5----^ ^-- n times idx=cat(2,ix{:...

How to add two values to a matrix each five values of that matrix in order to have a new matrix?

ix=arrayfun(@(x)[x,x*(ones(~mod(x,5),2))],1:numel(XY),'un',0); % multiple of 5----^ ^-- n times idx=cat(2,ix{:...

3 jours ago | 1

Answered

how to reduce the your matrix output

% Basic indexing: Output(1:end-1)

how to reduce the your matrix output

% Basic indexing: Output(1:end-1)

3 jours ago | 0

| accepted

Answered

Odd Numbers with missing multiples of a number

I leave the understanding part to the reader to understand whats going on: oddsNoFives=@(x,y)nonzeros((~sum(~mod(1:x,[2;y]),1))...

Odd Numbers with missing multiples of a number

I leave the understanding part to the reader to understand whats going on: oddsNoFives=@(x,y)nonzeros((~sum(~mod(1:x,[2;y]),1))...

3 jours ago | 0

Answered

How to do: "for each value of the vector A"

for ii = 1:numel(A) % this is for illustration purposes A(ii) end

How to do: "for each value of the vector A"

for ii = 1:numel(A) % this is for illustration purposes A(ii) end

3 jours ago | 0

Answered

"Undefined function" error when using multiple anonymous functions

Define c anonymous function before a_w and everything will be fine.

"Undefined function" error when using multiple anonymous functions

Define c anonymous function before a_w and everything will be fine.

3 jours ago | 1

| accepted

Answered

Could anyone help me to solve the issue.

NN = num2cell(num2cell(A,2),2)

Could anyone help me to solve the issue.

NN = num2cell(num2cell(A,2),2)

4 jours ago | 0

| accepted

Answered

Could anyone help me to solve the issue.

Looks like it's the same as your previous question , why not use it then?? [~,~,c]=unique(A,'stable'); B = B(c)

Could anyone help me to solve the issue.

Looks like it's the same as your previous question , why not use it then?? [~,~,c]=unique(A,'stable'); B = B(c)

4 jours ago | 0

Answered

could anyone help me to solve the issue

[~,~,c] = unique(B,'stable'); A = A(c)

could anyone help me to solve the issue

[~,~,c] = unique(B,'stable'); A = A(c)

4 jours ago | 1

| accepted

Answered

how can i add two matrix vertically with different column

m = max(numel(A),numel(B)); % Method 1 Wanted = reshape([A(:);B(:);zeros(m-numel(B),1)],[],2).' % Method 2 w = cellfun(@(x)...

how can i add two matrix vertically with different column

m = max(numel(A),numel(B)); % Method 1 Wanted = reshape([A(:);B(:);zeros(m-numel(B),1)],[],2).' % Method 2 w = cellfun(@(x)...

5 jours ago | 1

| accepted

Answered

I need help with my code. I don't understand what the error code is for. This is the error code Error: File: Lab1Modeling.m Line: 18 Column: 12 The expression to the left of the equals sign is not a valid target for an assignment.

% No loops needed: Cai = 4; Cbi = 1; P = .15; A = .85; N1 = Cai; N2 = Cbi; Start = 0; End = 11; Increment = 1; % if yo...

I need help with my code. I don't understand what the error code is for. This is the error code Error: File: Lab1Modeling.m Line: 18 Column: 12 The expression to the left of the equals sign is not a valid target for an assignment.

% No loops needed: Cai = 4; Cbi = 1; P = .15; A = .85; N1 = Cai; N2 = Cbi; Start = 0; End = 11; Increment = 1; % if yo...

5 jours ago | 0

Answered

Position of the left nearest one value in a vector

I don't know what you mean by shamely blocked. It's not a trivial one though. x=v; Start=strfind([0,v==1],[0,1]); End=strfin...

Position of the left nearest one value in a vector

I don't know what you mean by shamely blocked. It's not a trivial one though. x=v; Start=strfind([0,v==1],[0,1]); End=strfin...

5 jours ago | 1

| accepted

Answered

Created random sequence based on predefined vector

v = repelem(SP,Y); W = v(randperm(numel(v))) % numel(W)

Created random sequence based on predefined vector

v = repelem(SP,Y); W = v(randperm(numel(v))) % numel(W)

5 jours ago | 2

| accepted

Answered

Could anyone help me to solve the issue.

NN = num2cell(num2cell(position),2)

Could anyone help me to solve the issue.

NN = num2cell(num2cell(position),2)

5 jours ago | 0

| accepted