回答済み

How to create legend with multiple variables in a loop ?

You should put the figure creation and the creation of the legend outside the loop. You are merging the two texts, but you sh...

How to create legend with multiple variables in a loop ?

You should put the figure creation and the creation of the legend outside the loop. You are merging the two texts, but you sh...

19日 前 | 0

回答済み

Adding a cell to another cell in a specific position

What do you mean exactly by adding? %create some data n=3;m=5; A=num2cell(1:n).'; B=num2cell(2*n+(1:m)).'; %option 1: A1...

Adding a cell to another cell in a specific position

What do you mean exactly by adding? %create some data n=3;m=5; A=num2cell(1:n).'; B=num2cell(2*n+(1:m)).'; %option 1: A1...

20日 前 | 0

| 採用済み

回答済み

remove cell values of a column vector not contained in another column vector

doc ismember And maybe setdiff will do the trick as well.

remove cell values of a column vector not contained in another column vector

doc ismember And maybe setdiff will do the trick as well.

23日 前 | 0

回答済み

For loop in a for loop

You are resetting b in your loop, so only the last value of k matters. And the middle loop isn't a loop, as it is a scalar.

For loop in a for loop

You are resetting b in your loop, so only the last value of k matters. And the middle loop isn't a loop, as it is a scalar.

23日 前 | 1

| 採用済み

回答済み

plot all roots of a polynomial which has a interval coefficient

I meant something like this. N=200; Z=NaN(N,3); a=linspace(2,3,N); for n=1:numel(a) p=[1 a(n) 1 1]; z=roots(p); ...

plot all roots of a polynomial which has a interval coefficient

I meant something like this. N=200; Z=NaN(N,3); a=linspace(2,3,N); for n=1:numel(a) p=[1 a(n) 1 1]; z=roots(p); ...

25日 前 | 0

| 採用済み

回答済み

Unable to select seed points manually in region growing algorithm

getpts will return decimal values, so you will have to use round. I= rgb2gray((imread('TM25.jpg'))); figure,imshow(I) [x,y]=g...

Unable to select seed points manually in region growing algorithm

getpts will return decimal values, so you will have to use round. I= rgb2gray((imread('TM25.jpg'))); figure,imshow(I) [x,y]=g...

25日 前 | 0

| 採用済み

回答済み

Out of memory. The likely cause is an infinite recursion within the program.

Inside the function trans you are calling the function trans. Without any logic to stop this, this will result in an infinite lo...

Out of memory. The likely cause is an infinite recursion within the program.

Inside the function trans you are calling the function trans. Without any logic to stop this, this will result in an infinite lo...

26日 前 | 0

回答済み

Is there a way to call a part of a function using an index?

Reposting as answer: For the reasons set out in the answer by Steven (and the subsequent comments), numbering your variables in...

Is there a way to call a part of a function using an index?

Reposting as answer: For the reasons set out in the answer by Steven (and the subsequent comments), numbering your variables in...

26日 前 | 0

| 採用済み

回答済み

check for a pair in power hand

The feasibility of this depends on the size of the arrays involved. If your vectors are too large, the implicit expansion will c...

check for a pair in power hand

The feasibility of this depends on the size of the arrays involved. If your vectors are too large, the implicit expansion will c...

26日 前 | 0

| 採用済み

回答済み

R^2 meaning in linear mixed-effects model

The information you seek should be available on the Wikipedia page for the R². This is one of the most basic goodness-of-fit pa...

R^2 meaning in linear mixed-effects model

The information you seek should be available on the Wikipedia page for the R². This is one of the most basic goodness-of-fit pa...

27日 前 | 0

回答済み

Dividing the string data

You can split this with a regular expression. str='68753-9.990e+000 -9.900e-002 -9.990e-003-3.330e+000'; RE=['[+-]?',... %s...

Dividing the string data

You can split this with a regular expression. str='68753-9.990e+000 -9.900e-002 -9.990e-003-3.330e+000'; RE=['[+-]?',... %s...

27日 前 | 0

| 採用済み

回答済み

Matrix is singular to working precision. Meshgrid

You aren't using elementwise operations anywhere. You should replace every * by .* and every / by ./, that way you will not be d...

Matrix is singular to working precision. Meshgrid

You aren't using elementwise operations anywhere. You should replace every * by .* and every / by ./, that way you will not be d...

約1ヶ月 前 | 0

| 採用済み

回答済み

How can i process the elements of a vector in this way

A good first start would be to split your vector into a cell array. I suspect you will need diff, find, sign, and mat2cell. The...

How can i process the elements of a vector in this way

A good first start would be to split your vector into a cell array. I suspect you will need diff, find, sign, and mat2cell. The...

約1ヶ月 前 | 0

回答済み

How to create a matrice from selected rows from other matrices

You overwrote the entire variable. See the edits I made to your code. file_lat_1_fmt = 'October_01_2014_surface_lat_%02.0f.mat'...

How to create a matrice from selected rows from other matrices

You overwrote the entire variable. See the edits I made to your code. file_lat_1_fmt = 'October_01_2014_surface_lat_%02.0f.mat'...

約1ヶ月 前 | 0

| 採用済み

回答済み

Changing the color of stacking bar plot with many groups

students = rand(28,10); year = 2020: 2029; h=bar(year, students, 'stacked') ; legend('A', 'B', 'C', 'D', 'E', 'F', 'G',...

Changing the color of stacking bar plot with many groups

students = rand(28,10); year = 2020: 2029; h=bar(year, students, 'stacked') ; legend('A', 'B', 'C', 'D', 'E', 'F', 'G',...

約1ヶ月 前 | 0

| 採用済み

回答済み

Filling a white space in plot with another color

It is not possible in a direct way, but you can do things with patch to get a similar result: t=linspace(0,5*pi,1000); y=abs(s...

Filling a white space in plot with another color

It is not possible in a direct way, but you can do things with patch to get a similar result: t=linspace(0,5*pi,1000); y=abs(s...

約1ヶ月 前 | 0

| 採用済み

回答済み

How to make a linear regression from an excel file

You can use the unique function and a loop. (edited to include a custom function to extract a specific strain value) data=xlsr...

How to make a linear regression from an excel file

You can use the unique function and a loop. (edited to include a custom function to extract a specific strain value) data=xlsr...

約1ヶ月 前 | 0

回答済み

Draw line between two points if x distance is longer than...

You can easily find the indices of such locations (assuming x and y are sorted along x): x=[linspace(-16,-8,200) linspace(-5.5,...

Draw line between two points if x distance is longer than...

You can easily find the indices of such locations (assuming x and y are sorted along x): x=[linspace(-16,-8,200) linspace(-5.5,...

約1ヶ月 前 | 0

| 採用済み

回答済み

training model neural network

This sounds like an mlint warning. The source would be reduceDataset being false, which would cause the entire if block to be sk...

training model neural network

This sounds like an mlint warning. The source would be reduceDataset being false, which would cause the entire if block to be sk...

約1ヶ月 前 | 0

| 採用済み

回答済み

Unable to delete variable

removevars will only work on tables, not on structs. Use rmfield to remove a field from a struct.

Unable to delete variable

removevars will only work on tables, not on structs. Use rmfield to remove a field from a struct.

約1ヶ月 前 | 1

| 採用済み

回答済み

How to reverse a series of variable assignments?

I tend to use deal to make it more or less compact: [var,othervar,somevar]=deal(setting1,othersetting,somesetting); Now if I w...

How to reverse a series of variable assignments?

I tend to use deal to make it more or less compact: [var,othervar,somevar]=deal(setting1,othersetting,somesetting); Now if I w...

約1ヶ月 前 | 1

送信済み

ifversion

Determine if the current version satisfies a version restriction

約1ヶ月 前 | ダウンロード 1 件 |

回答済み

different outcome cellfun(@isempty,..) vs cellfun('isempty',...)

The reason is partly documented: "If you specify a function name rather than a function handle cellfun does not call any overlo...

different outcome cellfun(@isempty,..) vs cellfun('isempty',...)

The reason is partly documented: "If you specify a function name rather than a function handle cellfun does not call any overlo...

約1ヶ月 前 | 0

| 採用済み

回答済み

Latex interpreter in MATLAB Answers

The LaTeX editor is slightly hidden: it is labeled with the sigma and generally referred to in the Answers documentation as 'equ...

Latex interpreter in MATLAB Answers

The LaTeX editor is slightly hidden: it is labeled with the sigma and generally referred to in the Answers documentation as 'equ...

約1ヶ月 前 | 0

回答済み

How to graph discrete equation: y(n) = y(n-1) + 1 for 1000 samples

I would do something like this: %create a vector of the correct size y=NaN(1000,1); % by using NaN we should notice it if we s...

How to graph discrete equation: y(n) = y(n-1) + 1 for 1000 samples

I would do something like this: %create a vector of the correct size y=NaN(1000,1); % by using NaN we should notice it if we s...

約1ヶ月 前 | 0

| 採用済み

回答済み

How do I make a lower triangular matrix from a column vector?

The functions you should be looking for are tril and triu. You should be using triu, because you seem to want to fill your array...

How do I make a lower triangular matrix from a column vector?

The functions you should be looking for are tril and triu. You should be using triu, because you seem to want to fill your array...

約1ヶ月 前 | 3

回答済み

How to implement 2 vectors in a for-loop to get a matrix?

[A,B]=ndgrid(a,b); Then a single for-loop will do

How to implement 2 vectors in a for-loop to get a matrix?

[A,B]=ndgrid(a,b); Then a single for-loop will do

約1ヶ月 前 | 0

回答済み

학교 정보 변경하는 방법

Even if sometimes staff members look on this forum and post from time to time, the help on this forum is mostly provided by peop...

학교 정보 변경하는 방법

Even if sometimes staff members look on this forum and post from time to time, the help on this forum is mostly provided by peop...

約2ヶ月 前 | 0

回答済み

Error "too many input arguments"

You misread the error message slightly. The source of your issue is here: disp ('code2 =', code2) The disp function only allow...

Error "too many input arguments"

You misread the error message slightly. The source of your issue is here: disp ('code2 =', code2) The disp function only allow...

約2ヶ月 前 | 0

| 採用済み

解決済み

Draw a 'Z'.

Given _n_ as input, generate a n-by-n matrix like 'Z' by _0_ and _1_ . Example: n=5 ans= [1 1 1 1 1 0 0 0 1 ...

約2ヶ月 前