Answered

Check whether values of a certain column of a matrix is between two values

OK, still trying to understand everything, but I think this does what you want: % Sample input BUS(:, 8) = [2;2;2]; BUS(:,12)...

Check whether values of a certain column of a matrix is between two values

OK, still trying to understand everything, but I think this does what you want: % Sample input BUS(:, 8) = [2;2;2]; BUS(:,12)...

ungefär 2 månader ago | 0

| accepted

Answered

Check whether values of a certain column of a matrix is between two values

I think you intended volmax<0 & volmin <0 rather than volmax<0 | volmin <0 because you want to meet both conditions ("AND"),...

Check whether values of a certain column of a matrix is between two values

I think you intended volmax<0 & volmin <0 rather than volmax<0 | volmin <0 because you want to meet both conditions ("AND"),...

ungefär 2 månader ago | 0

Answered

Select only determined rows in a matrix

% First matrix A = rand(200,2); % New matrix B = A(10:10:end,:); % This will start with the 10th row. You could do B = A(1:...

Select only determined rows in a matrix

% First matrix A = rand(200,2); % New matrix B = A(10:10:end,:); % This will start with the 10th row. You could do B = A(1:...

2 månader ago | 0

| accepted

Answered

I need to find the the value of one variable against the other How can I do that ?

You can use the interp1 function: % Input data A = [5464.8 9075.5]; B = [0 1]; % Some new value of B: B_new = 0.7; % I...

I need to find the the value of one variable against the other How can I do that ?

You can use the interp1 function: % Input data A = [5464.8 9075.5]; B = [0 1]; % Some new value of B: B_new = 0.7; % I...

2 månader ago | 0

Answered

How can i make a dinamic row in a matrix or a cell?

In MATLAB, there cannot be an "empty" spot in a numerical array. So, you need to decide what you want in that spot. Sometimes a ...

How can i make a dinamic row in a matrix or a cell?

In MATLAB, there cannot be an "empty" spot in a numerical array. So, you need to decide what you want in that spot. Sometimes a ...

2 månader ago | 1

| accepted

Answered

Error this answer is NaN, in my runge-kutta code

Your code is long and complicated. It also has lots of unnecessary complication in it. For example, instead of Lambda1 = zeros(...

Error this answer is NaN, in my runge-kutta code

Your code is long and complicated. It also has lots of unnecessary complication in it. For example, instead of Lambda1 = zeros(...

2 månader ago | 1

Answered

Repeated Measure ANOVA 2x2

I have experience building mixed effects models in MATLAB, but I have not used ANOVA (repeated measures or otherwise). Therefore...

Repeated Measure ANOVA 2x2

I have experience building mixed effects models in MATLAB, but I have not used ANOVA (repeated measures or otherwise). Therefore...

2 månader ago | 1

Answered

Show temperature difference (delta) between 2 temps in a graph

Here is an example similar to what posted in my comment, but added line and text: rng default x = rand(1,5); mean_x = mean(...

Show temperature difference (delta) between 2 temps in a graph

Here is an example similar to what posted in my comment, but added line and text: rng default x = rand(1,5); mean_x = mean(...

2 månader ago | 0

Answered

how to combine two array of cells into one cellwise

A={ [2,3 ; 2,7] [3,2 ;3,4 ;3,8] [4,3 ; 4,5] [5,4 ; 5,10] }; B={ [2,3,4 ; 2,3,8 ; 2,7,8 ; 2,7,12] [3,2,7 ; 3,4,5 ; 3,8,7] [4...

how to combine two array of cells into one cellwise

A={ [2,3 ; 2,7] [3,2 ;3,4 ;3,8] [4,3 ; 4,5] [5,4 ; 5,10] }; B={ [2,3,4 ; 2,3,8 ; 2,7,8 ; 2,7,12] [3,2,7 ; 3,4,5 ; 3,8,7] [4...

2 månader ago | 0

| accepted

Answered

Sorting numbers randomly in a specified range without changing their positions

% Input A = [5 8 8 4 0 0 10 10 2 2]; % Find the pool of numbers that are available to fill % (because they don't appear in ...

Sorting numbers randomly in a specified range without changing their positions

% Input A = [5 8 8 4 0 0 10 10 2 2]; % Find the pool of numbers that are available to fill % (because they don't appear in ...

2 månader ago | 1

| accepted

Answered

Random matrix with no repeats in rows and columns.

I believe this does what you want. % Set the random number seed, for reproducibility rng default % The pool of random numbe...

Random matrix with no repeats in rows and columns.

I believe this does what you want. % Set the random number seed, for reproducibility rng default % The pool of random numbe...

2 månader ago | 1

Answered

Adjusting the legend spacing

Not directly answering your question, but a different (and more conventional) approach would be to move the limit annotations ou...

Adjusting the legend spacing

Not directly answering your question, but a different (and more conventional) approach would be to move the limit annotations ou...

2 månader ago | 0

Answered

How to multiply row of matrix A with column of matrix B?

If @Adam Danz is correct that you actually want to multiply all the elements of one column of A with one row of B, then % Defin...

How to multiply row of matrix A with column of matrix B?

If @Adam Danz is correct that you actually want to multiply all the elements of one column of A with one row of B, then % Defin...

2 månader ago | 0

Answered

Swapping my matlab student licence over

You need to deactivate the installation on the old computer.

Swapping my matlab student licence over

You need to deactivate the installation on the old computer.

2 månader ago | 0

| accepted

Answered

Why does it give me a problem stating that, Index must not exceed 1?

When you define del_ZS1 in the initial for loop, it is not a vector. It is a single, scalar value. When you try to do del_ZS1(...

Why does it give me a problem stating that, Index must not exceed 1?

When you define del_ZS1 in the initial for loop, it is not a vector. It is a single, scalar value. When you try to do del_ZS1(...

2 månader ago | 0

Answered

How do can I use every number in my loop?

% Set the random number seed, for reproducibility rng default % Create the x data x = rand(3,5); % Mean of all the x dat...

How do can I use every number in my loop?

% Set the random number seed, for reproducibility rng default % Create the x data x = rand(3,5); % Mean of all the x dat...

2 månader ago | 0

Answered

How to get the indices from a matrix and apply it to vectors?

Here is how you can do that, using my small example: rng default HIGH_WIND = 0.96; % <------ CHANGE THIS TO 15 lat = ran...

How to get the indices from a matrix and apply it to vectors?

Here is how you can do that, using my small example: rng default HIGH_WIND = 0.96; % <------ CHANGE THIS TO 15 lat = ran...

2 månader ago | 0

| accepted

Answered

My plot is not showing a line?

Here is a modified version of your code, where I changed Time to t (in the assignment of S), and I plotted your data as large in...

My plot is not showing a line?

Here is a modified version of your code, where I changed Time to t (in the assignment of S), and I plotted your data as large in...

2 månader ago | 0

Answered

How to make the color of the filled part transparent

Use the FaceAlpha property, with a value near zero: figure ax1 = axes; ax2 = axes; x=linspace(1,10,10); y=sin(x); plot(ax2...

How to make the color of the filled part transparent

Use the FaceAlpha property, with a value near zero: figure ax1 = axes; ax2 = axes; x=linspace(1,10,10); y=sin(x); plot(ax2...

2 månader ago | 0

| accepted

Answered

Not enough input arguments

You need real(ym) instead of real (ym)

Not enough input arguments

You need real(ym) instead of real (ym)

2 månader ago | 0

| accepted

Answered

How can i define a m by n symbolic matrix?

Matrices where the size is not predetermined cannot be defined in MATLAB. Source: this question/answer and the one it points to....

How can i define a m by n symbolic matrix?

Matrices where the size is not predetermined cannot be defined in MATLAB. Source: this question/answer and the one it points to....

2 månader ago | 0

Answered

How do I round this datetime to the nearest 0.1 second?

This is awkward, but it works. Guessing there is a better way. % Define original datetime input dt = datetime('01-Oct-2020 04:...

How do I round this datetime to the nearest 0.1 second?

This is awkward, but it works. Guessing there is a better way. % Define original datetime input dt = datetime('01-Oct-2020 04:...

2 månader ago | 0

Answered

problem looping through arrays

I think you intended if mod(M(i,j),2) == 0 rather than if mod(Q(i,j),2) == 0 Regarding the warning about Q changing size, yo...

problem looping through arrays

I think you intended if mod(M(i,j),2) == 0 rather than if mod(Q(i,j),2) == 0 Regarding the warning about Q changing size, yo...

2 månader ago | 0

Answered

Writing a function for the h-index

My understanding of h-index comes from publishing, for example this definition. If M is your data matrix, already sorted, then ...

Writing a function for the h-index

My understanding of h-index comes from publishing, for example this definition. If M is your data matrix, already sorted, then ...

2 månader ago | 0

| accepted

Answered

Check for incorrect argument data type or missing argument in call to function 'dateshift'.

I get the error from your first statement as well: % This statement would give an error % dateshift('17:03:41', 'start', 'hour...

Check for incorrect argument data type or missing argument in call to function 'dateshift'.

I get the error from your first statement as well: % This statement would give an error % dateshift('17:03:41', 'start', 'hour...

2 månader ago | 0

Answered

Finding x value for y values on a dataset.

The algorithm you want is not perfectly clear, and I can't see quite how you get the output from your input. But it seems that y...

Finding x value for y values on a dataset.

The algorithm you want is not perfectly clear, and I can't see quite how you get the output from your input. But it seems that y...

2 månader ago | 1

| accepted

Answered

not enough input arguments( not what you think)

How are you calling this function? I put your function in a file named beam.m, then called it from the Command Window using be...

not enough input arguments( not what you think)

How are you calling this function? I put your function in a file named beam.m, then called it from the Command Window using be...

2 månader ago | 1

Answered

Colon Notation Function using Matrices

A(2,2:3) means "the 2nd row, 2nd-through-3rd column of A". B(:,2) means "all rows, 2nd column of B". I strongly recommend th...

Colon Notation Function using Matrices

A(2,2:3) means "the 2nd row, 2nd-through-3rd column of A". B(:,2) means "all rows, 2nd column of B". I strongly recommend th...

2 månader ago | 0

Answered

How do I sum a vector (row) to a matrix?

A=[1 0 0 1; -1 0 1 1; 1 1 1 1]; B=[1 2 2 1]; A(1,:) = A(1,: ) + B

How do I sum a vector (row) to a matrix?

A=[1 0 0 1; -1 0 1 1; 1 1 1 1]; B=[1 2 2 1]; A(1,:) = A(1,: ) + B

2 månader ago | 0

Answered

Why I cannot exit the for cycle with the "z" counter?

It looks your syntax is correct for what you are trying to do, and the if statement is correctly placed. My best guess is that ...

Why I cannot exit the for cycle with the "z" counter?

It looks your syntax is correct for what you are trying to do, and the if statement is correctly placed. My best guess is that ...

2 månader ago | 0