已回答

Negative Numbers to the power of 0

Any arithmetic operation performed on variables will treat the variables as if it was wrapped with parentheses. Try this simp...

Negative Numbers to the power of 0

Any arithmetic operation performed on variables will treat the variables as if it was wrapped with parentheses. Try this simp...

4 years 前 | 0

已提交

xyannotation

creates an annotation object with the x-y coordinates of the data in a specific axes handle

4 years 前 | 1 次下载 |

已解决

Pizza!

Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.] Non-scor...

4 years 前

已回答

While loop isn't working

You have two mistakes 1. while loop should work with a scalar condition, but as far as I know if you use a logical vector it wi...

While loop isn't working

You have two mistakes 1. while loop should work with a scalar condition, but as far as I know if you use a logical vector it wi...

4 years 前 | 1

| 已接受

已回答

How do I fill a matrix with values of an one array based on another array?

If I understood correctly, try this: Wzr2D(1,:) = Wzr(Rr(1:5000) / dr) This should work if you can guarantee that all va...

How do I fill a matrix with values of an one array based on another array?

If I understood correctly, try this: Wzr2D(1,:) = Wzr(Rr(1:5000) / dr) This should work if you can guarantee that all va...

4 years 前 | 0

已回答

Matching unequal cell arrays

A = {124,252,1252,225,598,999}; B = {598,'plant';... 1252,'nil';... 252,'blue'}; [~, Ai_member, Bi_member] = i...

Matching unequal cell arrays

A = {124,252,1252,225,598,999}; B = {598,'plant';... 1252,'nil';... 252,'blue'}; [~, Ai_member, Bi_member] = i...

4 years 前 | 0

已回答

Storing Data From a For Loop

Assuming your Newton-Raphson method returns a scalar: D_c = 1:1:80; L_c = 120; C_s1c = 2.5e6; C_01c = 2e6; x = linspace(0...

Storing Data From a For Loop

Assuming your Newton-Raphson method returns a scalar: D_c = 1:1:80; L_c = 120; C_s1c = 2.5e6; C_01c = 2e6; x = linspace(0...

4 years 前 | 0

| 已接受

已回答

How to create an empty array to be filled?

Ma is a 0x0 empty vector: Ma = [] Ma = [] You can't multiply your 1x100 vector A by that using element by e...

How to create an empty array to be filled?

Ma is a 0x0 empty vector: Ma = [] Ma = [] You can't multiply your 1x100 vector A by that using element by e...

4 years 前 | 0

已回答

how to load a function in AppDesigner?

Seems to me that the warning is warning you against loading data into the workspace without controlling the variable names. Try...

how to load a function in AppDesigner?

Seems to me that the warning is warning you against loading data into the workspace without controlling the variable names. Try...

4 years 前 | 0

| 已接受

已回答

split a 2d matrix and create new 3d matrix from the results of the 2d matrix

If I got it right Matrix_T_A = repmat(reshape(T_A', 1, size(x, 2), size(x,1)), 24, 1, 1)

split a 2d matrix and create new 3d matrix from the results of the 2d matrix

If I got it right Matrix_T_A = repmat(reshape(T_A', 1, size(x, 2), size(x,1)), 24, 1, 1)

4 years 前 | 0

已回答

Plotting random points on a circle

Assuming you mean inside the circle and not on that circle, because then obviously the distance is 500 Anyway, it is much easie...

Plotting random points on a circle

Assuming you mean inside the circle and not on that circle, because then obviously the distance is 500 Anyway, it is much easie...

4 years 前 | 0

| 已接受

已回答

Find a word in a file then pick the value next to it

You've got the right idea. Regular expressions can be confusing at times I tested the regexp, the rest of the code is not teste...

Find a word in a file then pick the value next to it

You've got the right idea. Regular expressions can be confusing at times I tested the regexp, the rest of the code is not teste...

4 years 前 | 1

已回答

Custom Object property save/load problem

It seems to me that you are saving a 3 column table to the .mat file, then when you load it again, it uses the property to set i...

Custom Object property save/load problem

It seems to me that you are saving a 3 column table to the .mat file, then when you load it again, it uses the property to set i...

4 years 前 | 0

| 已接受

已回答

How can read 30 text data files in matlab ?

you can alwsay put all of them in a single directory, then use dir to get all file names and iterate through all of them: path ...

How can read 30 text data files in matlab ?

you can alwsay put all of them in a single directory, then use dir to get all file names and iterate through all of them: path ...

4 years 前 | 0

已回答

How to add a sequential number in a column of tables cell?

for i = 1:numel(Test) t = Test{i}; t.gridded_model = strcat(t.gridded_model, '_', num2str(i)); Test{i} = t; end

How to add a sequential number in a column of tables cell?

for i = 1:numel(Test) t = Test{i}; t.gridded_model = strcat(t.gridded_model, '_', num2str(i)); Test{i} = t; end

4 years 前 | 1

| 已接受

已回答

Text file has headers that are 2X4 and are repeated randomly within the data.

str = fileread('MCT_Data.txt'); nums = cellfun(@str2double, regexp(str, '([\d.,]+)', 'match')); x = reshape(nums, 4, [])' x...

Text file has headers that are 2X4 and are repeated randomly within the data.

str = fileread('MCT_Data.txt'); nums = cellfun(@str2double, regexp(str, '([\d.,]+)', 'match')); x = reshape(nums, 4, [])' x...

4 years 前 | 0

| 已接受

已回答

Converting all arrays inside a cell to tables

c = repmat({(1:10)'}, 3,3) c = 3×3 cell array Columns 1 through 2 {10×1 double} {10×1 double} {1...

Converting all arrays inside a cell to tables

c = repmat({(1:10)'}, 3,3) c = 3×3 cell array Columns 1 through 2 {10×1 double} {10×1 double} {1...

4 years 前 | 1

已回答

Error with find function in a for loop

Find accepts a logical vector and returns all the indices containing 1. The problem is you are giving find a scalar value so...

Error with find function in a for loop

Find accepts a logical vector and returns all the indices containing 1. The problem is you are giving find a scalar value so...

5 years 前 | 1

| 已接受

已回答

How to plot colorbar as seperate image?

I assume your image is grayscale, right? If I understand you correctly: min_val=min(example_img(:)); max_val=max(example_img...

How to plot colorbar as seperate image?

I assume your image is grayscale, right? If I understand you correctly: min_val=min(example_img(:)); max_val=max(example_img...

5 years 前 | 1

| 已接受

已回答

How to return no output in a function with output?

output variables, the same as input variables, are optional You can choose to return one, both or neither of your outputs. In ...

How to return no output in a function with output?

output variables, the same as input variables, are optional You can choose to return one, both or neither of your outputs. In ...

5 years 前 | 1

已回答

Can I run MATLAB code on a server?

I think this may be what you are looking for https://www.mathworks.com/help/compiler/webapps/install-matlab-web-app-server.html...

Can I run MATLAB code on a server?

I think this may be what you are looking for https://www.mathworks.com/help/compiler/webapps/install-matlab-web-app-server.html...

5 years 前 | 0

已回答

app designer private and public properties?

If these functions are methods of your app, you can use private properties from within these methods, but if they are functions ...

app designer private and public properties?

If these functions are methods of your app, you can use private properties from within these methods, but if they are functions ...

5 years 前 | 1

| 已接受

已回答

Group cells in a matrix per column based on an indexed starting point

you can map the ends of each series of ones using diff: C = [diff(B, 1, 1) == -1; B(end, :)]; then check each occurence of C ...

Group cells in a matrix per column based on an indexed starting point

you can map the ends of each series of ones using diff: C = [diff(B, 1, 1) == -1; B(end, :)]; then check each occurence of C ...

5 years 前 | 0

已回答

Best practice for updating default parameter values inside a function, preferably with struct

Using assignin as your configuration strategy is a bad idea not only due to bad performance. It's also very prone to bugs. lets ...

Best practice for updating default parameter values inside a function, preferably with struct

Using assignin as your configuration strategy is a bad idea not only due to bad performance. It's also very prone to bugs. lets ...

5 years 前 | 3

| 已接受

已回答

Cross tabulation row percentages

How about something like that? t{:,{'sale1','sale2'}} = t{:,{'sale1','sale2'}}./t.totalsales * 100 Given that t is your ...

Cross tabulation row percentages

How about something like that? t{:,{'sale1','sale2'}} = t{:,{'sale1','sale2'}}./t.totalsales * 100 Given that t is your ...

5 years 前 | 0

| 已接受

已回答

Help me about my error on index in position 2 exceeds array bounds (must not exceed 800).

I have no idea what rm and cm are, but at some iteration y=(j-1)*8 + 8 is greater than the number of columns in your matrix u...

Help me about my error on index in position 2 exceeds array bounds (must not exceed 800).

I have no idea what rm and cm are, but at some iteration y=(j-1)*8 + 8 is greater than the number of columns in your matrix u...

5 years 前 | 0

已回答

How do I determine which row my value change significantly

Im assuming its roughly 375 and not exactly that value, otherwise go with Turlough Hughes' solution which is simpler. The eas...

How do I determine which row my value change significantly

Im assuming its roughly 375 and not exactly that value, otherwise go with Turlough Hughes' solution which is simpler. The eas...

5 years 前 | 0

已回答

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...

5 years 前 | 1

| 已接受