回答済み

How to plot a function with different values

You can make M a column vector, then calculate S as a matrix then if you plot it against t which is a row vector plot should tr...

How to plot a function with different values

You can make M a column vector, then calculate S as a matrix then if you plot it against t which is a row vector plot should tr...

1年以上 前 | 1

| 採用済み

回答済み

How to extract a value out of different .mat files and save them into an array

s = load('my_file_5.mat'); will return a struct, each variable in the file will be put in a field in that struct if all files ...

How to extract a value out of different .mat files and save them into an array

s = load('my_file_5.mat'); will return a struct, each variable in the file will be put in a field in that struct if all files ...

1年以上 前 | 0

| 採用済み

回答済み

Mean of the third dimension

try this: avgPerYear = nanmean(rain, [1,2]); that would generate an inconvenient 3rd dimention vector so you can reshape it i...

Mean of the third dimension

try this: avgPerYear = nanmean(rain, [1,2]); that would generate an inconvenient 3rd dimention vector so you can reshape it i...

1年以上 前 | 1

回答済み

how to find out how many columns have more than 50 elements which are greater than 1?

x = rand(100) * 2; atLeast50 = sum(x > 1, 1) > 50;

how to find out how many columns have more than 50 elements which are greater than 1?

x = rand(100) * 2; atLeast50 = sum(x > 1, 1) > 50;

1年以上 前 | 0

回答済み

Array indices must be positive integers or logical values.

in Matlab, matrix indices start from one, not zero like other programming languages, but your index starts from zero: colum-dtn...

Array indices must be positive integers or logical values.

in Matlab, matrix indices start from one, not zero like other programming languages, but your index starts from zero: colum-dtn...

2年弱 前 | 0

回答済み

Is there a faster way of splitting a cell array into numeric array while preserving NaN?

try this endsWithSemicolon = cellfun(@(s) endsWith(s, ';'), data); x = cellfun(@(s) textscan(s, '%f', 'Delimiter', ';', 'Empty...

Is there a faster way of splitting a cell array into numeric array while preserving NaN?

try this endsWithSemicolon = cellfun(@(s) endsWith(s, ';'), data); x = cellfun(@(s) textscan(s, '%f', 'Delimiter', ';', 'Empty...

2年弱 前 | 2

| 採用済み

回答済み

A question on regexprep

A is not a match for your regexp, match = regexp(s,'\<(\w)(\w*)(\w)\>', 'match') match = 1×5 cell array {'John'...

A question on regexprep

A is not a match for your regexp, match = regexp(s,'\<(\w)(\w*)(\w)\>', 'match') match = 1×5 cell array {'John'...

2年弱 前 | 0

| 採用済み

回答済み

What exactly is a StartPoint for a Curve Fitting Tool, its significance and how it works?

curve fitting works by trying to find the parameters of your model, lets say you are trying to fit a gaussian to a single peak c...

What exactly is a StartPoint for a Curve Fitting Tool, its significance and how it works?

curve fitting works by trying to find the parameters of your model, lets say you are trying to fit a gaussian to a single peak c...

2年弱 前 | 3

| 採用済み

回答済み

how do I allow user to choose a folder to run the rest of the functions?

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

how do I allow user to choose a folder to run the rest of the functions?

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

2年弱 前 | 0

回答済み

Create array of “deep” struct (scalar) fields

As always, you can use a small utility function to drill down the object hierarchy It's probably not the most elegant solution ...

Create array of “deep” struct (scalar) fields

As always, you can use a small utility function to drill down the object hierarchy It's probably not the most elegant solution ...

2年弱 前 | 1

回答済み

Plot text (x axis) vs. y axis (numbers)

Why don't you convert x to a number? % mock data hrs = arrayfun(@(n) [num2str(n) 'H'], 0:23, 'UniformOutput', false); hrs(1:1...

Plot text (x axis) vs. y axis (numbers)

Why don't you convert x to a number? % mock data hrs = arrayfun(@(n) [num2str(n) 'H'], 0:23, 'UniformOutput', false); hrs(1:1...

2年弱 前 | 0

回答済み

Indexing a matrix that's not in the workspace

you can write a utility function to do that function value = debugPrint(a, i) value = a(i); end %% or using an anonymo...

Indexing a matrix that's not in the workspace

you can write a utility function to do that function value = debugPrint(a, i) value = a(i); end %% or using an anonymo...

2年弱 前 | 0

| 採用済み

回答済み

How do I unstack/transpose table in Matlab?

unstack groups using a third column, but you can trick it to do what you want by adding a fake third column id={'id1';'id1';'id...

How do I unstack/transpose table in Matlab?

unstack groups using a third column, but you can trick it to do what you want by adding a fake third column id={'id1';'id1';'id...

2年弱 前 | 1

| 採用済み

回答済み

GUI gives error after moving to a different computer

Another possible workaround would be to create a stub of this function Unfortunately this function is not a builtin, so builtin...

GUI gives error after moving to a different computer

Another possible workaround would be to create a stub of this function Unfortunately this function is not a builtin, so builtin...

2年弱 前 | 1

回答済み

How to write elements of a nested cell array to an excel?

The problem starts with the different sizes of each rpw which makes it more complecated to unravel the nested cell arrays c...

How to write elements of a nested cell array to an excel?

The problem starts with the different sizes of each rpw which makes it more complecated to unravel the nested cell arrays c...

2年弱 前 | 0

回答済み

How to remove numbers that only show up once in a list of recurring numbers

x = [1,1,1,1,2,3,3,3,3,4,5,5,5,5,6,7,7,7,7,7,7,8,53,54,54,54,54,54]; numbers = 1:max(x); numx = accumarray(x(:), 1); atLeast2...

How to remove numbers that only show up once in a list of recurring numbers

x = [1,1,1,1,2,3,3,3,3,4,5,5,5,5,6,7,7,7,7,7,7,8,53,54,54,54,54,54]; numbers = 1:max(x); numx = accumarray(x(:), 1); atLeast2...

2年弱 前 | 0

回答済み

How to run an App every 2 hours

Use a <https://www.mathworks.com/help/matlab/matlab_prog/use-a-matlab-timer-object.html timer>

How to run an App every 2 hours

Use a <https://www.mathworks.com/help/matlab/matlab_prog/use-a-matlab-timer-object.html timer>

2年弱 前 | 0

回答済み

How to replace missing values in a cell array?

x = {missing(), 1, 2, 3, missing(), missing(), 5}; mask = cellfun(@ismissing, x); x(mask) = {[]}; % or whatever value yo...

How to replace missing values in a cell array?

x = {missing(), 1, 2, 3, missing(), missing(), 5}; mask = cellfun(@ismissing, x); x(mask) = {[]}; % or whatever value yo...

2年弱 前 | 2

| 採用済み

回答済み

Interpolating random values to smoothen a curve

you can implement the stavisky golay filter basically the idea is to iterate through the data and on each point perform a polyn...

Interpolating random values to smoothen a curve

you can implement the stavisky golay filter basically the idea is to iterate through the data and on each point perform a polyn...

2年弱 前 | 1

| 採用済み

回答済み

Scatter Plot with string in x-axis and integer on y-axis

Maybe bar chart would be better for you, but if you must use scatter plot scatter(1:5,percentage); set(gca, 'XTick', 1:5...

Scatter Plot with string in x-axis and integer on y-axis

Maybe bar chart would be better for you, but if you must use scatter plot scatter(1:5,percentage); set(gca, 'XTick', 1:5...

2年弱 前 | 0

回答済み

how to add lable into rows

You need to use an inner join t3 = join(otherTable,goods,'key','keyColumnName') Or if the key column name is different i...

how to add lable into rows

You need to use an inner join t3 = join(otherTable,goods,'key','keyColumnName') Or if the key column name is different i...

2年弱 前 | 0

| 採用済み

回答済み

Putting the result from eval into a cell array

please please please don't use eval to access varriable names eval is not built for that, however, for some reason the first th...

Putting the result from eval into a cell array

please please please don't use eval to access varriable names eval is not built for that, however, for some reason the first th...

2年弱 前 | 0

回答済み

how to replace the elements row by rows instead of column by column in matrix

find(A==3,1,'first') find(A==3,1,'last') These lines find linear indices not [row, col] subsets. Linear indices go alon...

how to replace the elements row by rows instead of column by column in matrix

find(A==3,1,'first') find(A==3,1,'last') These lines find linear indices not [row, col] subsets. Linear indices go alon...

2年弱 前 | 0

| 採用済み

回答済み

MATLAB HELP ME PLS

The trapezoidal integration method is a numeric calculation which approximates the area trapped between the curve and the x axis...

MATLAB HELP ME PLS

The trapezoidal integration method is a numeric calculation which approximates the area trapped between the curve and the x axis...

2年弱 前 | 0

回答済み

How to access a function under a given path?

A possible solution would be to make every git branch a package. You will have to make all subfolders packages as well, but that...

How to access a function under a given path?

A possible solution would be to make every git branch a package. You will have to make all subfolders packages as well, but that...

2年弱 前 | 0

| 採用済み

回答済み

how to convert the fraction part into intger?

What about K = round(mod((abs (L)-floor (abs (L))) *10e8 , 256)) Or K = floor(mod((abs (L)-floor (abs (L))) *10e8 ...

how to convert the fraction part into intger?

What about K = round(mod((abs (L)-floor (abs (L))) *10e8 , 256)) Or K = floor(mod((abs (L)-floor (abs (L))) *10e8 ...

2年弱 前 | 0

回答済み

For loop with subs

You are setting a 2x3 matrix into l2, which duplicates mat for all possible substitutions 2x3 times 2x3 = 4x9

For loop with subs

You are setting a 2x3 matrix into l2, which duplicates mat for all possible substitutions 2x3 times 2x3 = 4x9

2年弱 前 | 0

質問

How to change property behavior for a mocked object

I'm trying to use the mocking framework for unit tests I'm trying to make the property of a mock object return another mock obj...

2年弱 前 | 1 件の回答 | 0

回答済み

How to know dimensions to give in trapz function

let's say you have a column vector x and you calculate y according to y = ax^2 now if a is a vector, you will get a matrix y: ...

How to know dimensions to give in trapz function

let's say you have a column vector x and you calculate y according to y = ax^2 now if a is a vector, you will get a matrix y: ...

2年弱 前 | 0