Communication through MATLAB is always better than arguing.

Answered

Help... what is my mistake and what should i do now?? please

Since you have shown efforts: too_young = under_age(2, []) % [] means no limit was given function too_young = under_age(...

Help... what is my mistake and what should i do now?? please

Since you have shown efforts: too_young = under_age(2, []) % [] means no limit was given function too_young = under_age(...

environ 6 heures ago | 0

| accepted

Answered

perform matrix operation without for loop

xe = exp(reshape(beta, 1, 1, []) .* exp_data) .* (exp_data > 1.5) + 1 * (exp_data <= 1.5); % use bsxfun() for implicit expansio...

perform matrix operation without for loop

xe = exp(reshape(beta, 1, 1, []) .* exp_data) .* (exp_data > 1.5) + 1 * (exp_data <= 1.5); % use bsxfun() for implicit expansio...

environ 10 heures ago | 0

Answered

after how many terms does an equation have the same five decimals as pi/4?

if abs(p - pi/4) < 1e-5 Look through the tag floating-point to know why tolerance is used to compare decimals.

after how many terms does an equation have the same five decimals as pi/4?

if abs(p - pi/4) < 1e-5 Look through the tag floating-point to know why tolerance is used to compare decimals.

environ 10 heures ago | 0

| accepted

Question

Viewing figure is not possible.

Why can't I view the figure? P.S: The following is just to familiarise with Python in MATLAB environment. System: MacOs. >> p...

environ 15 heures ago | 1 answer | 0

Answered

Cell array variable problem

Structure_Global_Stiffness{kk,zz}(~eye(3)) = 0;

Cell array variable problem

Structure_Global_Stiffness{kk,zz}(~eye(3)) = 0;

environ 16 heures ago | 0

| accepted

Answered

Error: The input character is not valid in MATLAB statements or expressions.

Change " to '

Error: The input character is not valid in MATLAB statements or expressions.

Change " to '

environ 17 heures ago | 0

Answered

How to convert first cell value into zero

cell_array(cellfun(@isstring, cell_array)) = {0}

How to convert first cell value into zero

cell_array(cellfun(@isstring, cell_array)) = {0}

environ 18 heures ago | 1

Answered

Implementation of formula in a single line.

_“Implementation of formula in a single line.”_ Z = (L * A * (exp(X) - 1)) .* (X < 0) + (L * X) .* (X >= 0);

Implementation of formula in a single line.

_“Implementation of formula in a single line.”_ Z = (L * A * (exp(X) - 1)) .* (X < 0) + (L * X) .* (X >= 0);

environ 19 heures ago | 0

| accepted

Answered

Defining Variables In a Function

for index = 1 : numel(a) c(index) = a(index) + b(index); end By the way it’s simply: c = a + b; % don’t know w...

Defining Variables In a Function

for index = 1 : numel(a) c(index) = a(index) + b(index); end By the way it’s simply: c = a + b; % don’t know w...

environ 22 heures ago | 0

Answered

Can we put all of these str2num in one function?

Usually str2num() is not recommended. Simply use: sum(C1 - '0')

Can we put all of these str2num in one function?

Usually str2num() is not recommended. Simply use: sum(C1 - '0')

1 jour ago | 0

| accepted

Answered

How to create a matrix from other matrixes

I undertand your pain of online classes brother. Have a read: <https://www.mathworks.com/company/newsletters/articles/matrix-...

How to create a matrix from other matrixes

I undertand your pain of online classes brother. Have a read: <https://www.mathworks.com/company/newsletters/articles/matrix-...

1 jour ago | 1

| accepted

Answered

extract structure array value

You need to use a loop. <https://www.mathworks.com/help/matlab/matlab_prog/access-data-in-a-structure-array.html#d122e28845 *...

extract structure array value

You need to use a loop. <https://www.mathworks.com/help/matlab/matlab_prog/access-data-in-a-structure-array.html#d122e28845 *...

1 jour ago | 0

Answered

Why does putting a space after a function give a vector output?

Is that an assignment or something?? <https://www.mathworks.com/matlabcentral/answers/599011-floor-function-with-a-space-givi...

Why does putting a space after a function give a vector output?

Is that an assignment or something?? <https://www.mathworks.com/matlabcentral/answers/599011-floor-function-with-a-space-givi...

1 jour ago | 0

| accepted

Answered

Change text to 0 in a cell array

cell_array(cellfun(@ischar, cell_array)) = {0}

Change text to 0 in a cell array

cell_array(cellfun(@ischar, cell_array)) = {0}

1 jour ago | 1

Answered

index multiple columns in cell array

Replace 8:10 With [8:10, 15:18]

index multiple columns in cell array

Replace 8:10 With [8:10, 15:18]

2 jours ago | 1

| accepted

Answered

Define a column series

t = (1:10).' %Or t(:) % from your example

Define a column series

t = (1:10).' %Or t(:) % from your example

3 jours ago | 1

| accepted

Answered

how to find the largest number in the first 13 number in an array?

max(reshape(array, [], 13))

how to find the largest number in the first 13 number in an array?

max(reshape(array, [], 13))

3 jours ago | 1

| accepted

Answered

convert a 3D matrix to a 2D matrix

reshape(permute(val, [2, 1, 3]), size(val, 2), []).'

convert a 3D matrix to a 2D matrix

reshape(permute(val, [2, 1, 3]), size(val, 2), []).'

3 jours ago | 0

| accepted

Answered

I need help please, how can I write a program to count the number of digits of an integer the user entered ?

strlength(abs(5984) + "")

I need help please, how can I write a program to count the number of digits of an integer the user entered ?

strlength(abs(5984) + "")

3 jours ago | 0

| accepted

Answered

How do i get the values of a 2D matrix based on column indices ?

Output = matrix(sub2ind(size(matrix), 1 : size(matrix, 1), column_indices))

How do i get the values of a 2D matrix based on column indices ?

Output = matrix(sub2ind(size(matrix), 1 : size(matrix, 1), column_indices))

3 jours ago | 0

| accepted

Answered

Reshape a multidimensional matrix

reshape(permute(matrix, [3, 2, 1]), 144, [ ])

Reshape a multidimensional matrix

reshape(permute(matrix, [3, 2, 1]), 144, [ ])

3 jours ago | 0

Answered

Combining two separate arrays into singular payoff matrix

P = reshape(num2cell([A(:), B(:)], 2), [], size(A, 2)); celldisp(P)

Combining two separate arrays into singular payoff matrix

P = reshape(num2cell([A(:), B(:)], 2), [], size(A, 2)); celldisp(P)

3 jours ago | 0

| accepted