Answered

Remove single cell from matrix

_”Remove single cell from matrix“_ b(2, 2) = nan; % since matrix cannot have holes replace it with nans

Remove single cell from matrix

_”Remove single cell from matrix“_ b(2, 2) = nan; % since matrix cannot have holes replace it with nans

3 días ago | 0

| accepted

Answered

How do I create a set of random numbers with a given set of numbers? Using randi command.

a(randi(numel(a), 1, numel(a))) % for unique numbers use randperm()

How do I create a set of random numbers with a given set of numbers? Using randi command.

a(randi(numel(a), 1, numel(a))) % for unique numbers use randperm()

3 días ago | 1

| accepted

Answered

How can I evaluate elements in an array individually. Typing in a range of eg -2:2 the negative elements are being evaluated at an incorrect condition (1st elseif condition). What is the problem

elseif (c > 0) && (c <= 10) elseif (c > 10) && (c <= 15)

How can I evaluate elements in an array individually. Typing in a range of eg -2:2 the negative elements are being evaluated at an incorrect condition (1st elseif condition). What is the problem

elseif (c > 0) && (c <= 10) elseif (c > 10) && (c <= 15)

3 días ago | 0

Answered

Symbolic matrix with sine and cosine to numerical values.

double(subs(T06)) %or vpa(subs(T06))

Symbolic matrix with sine and cosine to numerical values.

double(subs(T06)) %or vpa(subs(T06))

5 días ago | 1

Answered

Adding successive cells in a columns

Assuming after sir Walter’s comment: T = TabLe{:, :}; n = numel(TabLe); t = [TabLe, nan(1, 16 - mod(n, 16))]; Wanted ...

Adding successive cells in a columns

Assuming after sir Walter’s comment: T = TabLe{:, :}; n = numel(TabLe); t = [TabLe, nan(1, 16 - mod(n, 16))]; Wanted ...

7 días ago | 0

Answered

function of two variables

C = cell(numel(x1)); for k = 1:numel(x1) C{k} = f(x1(k), x2(k)); % of f() is vectorised you won’t need a loop end...

function of two variables

C = cell(numel(x1)); for k = 1:numel(x1) C{k} = f(x1(k), x2(k)); % of f() is vectorised you won’t need a loop end...

7 días ago | 0

Answered

Removing elements in one matrix with same position as those in another matrix in matlab

H(isnan(Z)) = nan

Removing elements in one matrix with same position as those in another matrix in matlab

H(isnan(Z)) = nan

7 días ago | 0

| accepted

Answered

Element-wise multiplication of a 3D matrix KxLxM by a 1D vector M

C = A .* reshape(B,1,1,[])

Element-wise multiplication of a 3D matrix KxLxM by a 1D vector M

C = A .* reshape(B,1,1,[])

7 días ago | 1

| accepted

Answered

Problem with using symbolic expersion in function toeplitz

Might be a bug. I didn’t have any problems with 2020a either. It’s better if you make a big report.

Problem with using symbolic expersion in function toeplitz

Might be a bug. I didn’t have any problems with 2020a either. It’s better if you make a big report.

7 días ago | 0

| accepted

Answered

How can I apply a condition on a culumn?

A = (A - 360) .* (A > 360) + (A + 360) .* (A < 0) + A .* ((A >= 0) & (A <= 360));

How can I apply a condition on a culumn?

A = (A - 360) .* (A > 360) + (A + 360) .* (A < 0) + A .* ((A >= 0) & (A <= 360));

7 días ago | 0

Answered

what is degeneracy of matrix A=[-1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1];

Hint: doc diag

what is degeneracy of matrix A=[-1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1];

Hint: doc diag

7 días ago | 0

| accepted

Answered

Why didn't I get an error for my matrices?

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

Why didn't I get an error for my matrices?

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

8 días ago | 0

Answered

I don't know how to type this in matlab.

t = 0.037 exp(t-2)^1/2 Start with MATLAB On-ramp course.

I don't know how to type this in matlab.

t = 0.037 exp(t-2)^1/2 Start with MATLAB On-ramp course.

8 días ago | 0

Answered

Is vectorizing this even possible?

A simple for loop is the best and easier to understand: vec3 = zeros(5,1); vec3(1) = 1; for k = 2:5 % edited af...

Is vectorizing this even possible?

A simple for loop is the best and easier to understand: vec3 = zeros(5,1); vec3(1) = 1; for k = 2:5 % edited af...

8 días ago | 0

Answered

How to select consecutive values with the specified interval ?

reshape((1:10:50) + (0:2).', 1, []) % reshape(bsxfun(@plus, 1:10:50, (0:2).'), 1, []) %%for older versions

How to select consecutive values with the specified interval ?

reshape((1:10:50) + (0:2).', 1, []) % reshape(bsxfun(@plus, 1:10:50, (0:2).'), 1, []) %%for older versions

8 días ago | 0

| accepted

Answered

Substitute string to double

Requires Symbolic Math Toolbox: Wanted = str2sym(regexprep(Acell, {'R1', 'R2'}, {R1, R2})) %or for older versions Wanted = sy...

Substitute string to double

Requires Symbolic Math Toolbox: Wanted = str2sym(regexprep(Acell, {'R1', 'R2'}, {R1, R2})) %or for older versions Wanted = sy...

8 días ago | 0

Answered

Why is my account license says expired?

Contact your University's IT department.

Why is my account license says expired?

Contact your University's IT department.

8 días ago | 0

Answered

Is Mac an option for working MATLAB?

<https://www.mathworks.com/support/requirements/matlab-system-requirements.html> - everything is there

Is Mac an option for working MATLAB?

<https://www.mathworks.com/support/requirements/matlab-system-requirements.html> - everything is there

8 días ago | 1

Answered

Interpreting Excel Data in MATLAB

Read it using readmatrix() or readtable(). sort() it row wise , index from 3 to end. mean() row wise. Use > for thresho...

Interpreting Excel Data in MATLAB

Read it using readmatrix() or readtable(). sort() it row wise , index from 3 to end. mean() row wise. Use > for thresho...

9 días ago | 0

Answered

How can I run a list of variables through a function to return a list of outputs?

Vectorise the function, Zum Beispiel: Output = Test(1, 1, 1 : 10) % function call function Output = Test(x,y,z) % function ...

How can I run a list of variables through a function to return a list of outputs?

Vectorise the function, Zum Beispiel: Output = Test(1, 1, 1 : 10) % function call function Output = Test(x,y,z) % function ...

9 días ago | 0

Answered

Calculations on every 2nd row in a matrix in sets of 2 rows

matrix(1 : 2 : end, :) - matrix(2 : 2 : end, :) % ?

Calculations on every 2nd row in a matrix in sets of 2 rows

matrix(1 : 2 : end, :) - matrix(2 : 2 : end, :) % ?

9 días ago | 0

Answered

How to take Inverse of a 6x6 cell array in MATLAB?

Assuming by inverse you mean *transpose* : C_dry = cellfun(@transpose, C_dry, 'un', 0)

How to take Inverse of a 6x6 cell array in MATLAB?

Assuming by inverse you mean *transpose* : C_dry = cellfun(@transpose, C_dry, 'un', 0)

9 días ago | 0

Answered

What is meant by double here ?? is it data type

<https://www.mathworks.com/help/matlab/ref/double.html>

What is meant by double here ?? is it data type

<https://www.mathworks.com/help/matlab/ref/double.html>

10 días ago | 0

Answered

Error creating matrix using a integer and vector in Matlab

A = x(:) .^ (0:3)

Error creating matrix using a integer and vector in Matlab

A = x(:) .^ (0:3)

10 días ago | 0

| accepted