回答済み

How to plot weeknumbers (integers) in a graph without leaving gaps for weeks that do not exist

Maybe you can adapt this approach to your situation. dt = datetime(2023,1,[1 8 15 22 4*22+3*[7 14 21]]) % example datetime valu...

How to plot weeknumbers (integers) in a graph without leaving gaps for weeks that do not exist

Maybe you can adapt this approach to your situation. dt = datetime(2023,1,[1 8 15 22 4*22+3*[7 14 21]]) % example datetime valu...

4ヶ月 前 | 0

回答済み

3D spherical plot is cut off by the edges of the graphing window

This doesn't work if you want to be able to interactively zoom in on a region, but if you have in mind a specific range of X, Y,...

3D spherical plot is cut off by the edges of the graphing window

This doesn't work if you want to be able to interactively zoom in on a region, but if you have in mind a specific range of X, Y,...

4ヶ月 前 | 0

回答済み

Fill editfield text value with string from a table

For this specific example, readlines might work better than readtable. DataComments = readlines('file7.csv') Then pick which o...

Fill editfield text value with string from a table

For this specific example, readlines might work better than readtable. DataComments = readlines('file7.csv') Then pick which o...

4ヶ月 前 | 0

回答済み

Why don't the markers have the correct color in the legend?

The problem is that each of your calls to scatter is creating five separate sets of data for a total of 10 sets. But, you only r...

Why don't the markers have the correct color in the legend?

The problem is that each of your calls to scatter is creating five separate sets of data for a total of 10 sets. But, you only r...

4ヶ月 前 | 1

| 採用済み

回答済み

How to add seconds to a HH:mm DateTime array ?

datetime objects always have a seconds field. If you don't set it, it will already be zero by default, so you don't need to "ad...

How to add seconds to a HH:mm DateTime array ?

datetime objects always have a seconds field. If you don't set it, it will already be zero by default, so you don't need to "ad...

4ヶ月 前 | 0

回答済み

how to use previous value in simulink? [(k-1) value]

It looks like what you need to do is remove the new_filtered_V input from your MATLAB function block and add this line at the to...

how to use previous value in simulink? [(k-1) value]

It looks like what you need to do is remove the new_filtered_V input from your MATLAB function block and add this line at the to...

4ヶ月 前 | 1

| 採用済み

回答済み

double conditional in one line

You have to join the multiple conditions with a logical operator. For example, the condition 0<x<1 is written like this x=0.23...

double conditional in one line

You have to join the multiple conditions with a logical operator. For example, the condition 0<x<1 is written like this x=0.23...

4ヶ月 前 | 0

回答済み

Saving a struct to a text file exactly how it appears in command window

Here is one approach. path='F:\settings.txt'; settings = struct; %Create structure called settings % settings.exposure_...

Saving a struct to a text file exactly how it appears in command window

Here is one approach. path='F:\settings.txt'; settings = struct; %Create structure called settings % settings.exposure_...

4ヶ月 前 | 1

| 採用済み

回答済み

Click in the beginning and end of pure tone

Try adding ramps at the beginning and end to avoid the discontinuities of starting and stopping the tone. spl_rms = 60; spl_p0...

Click in the beginning and end of pure tone

Try adding ramps at the beginning and end to avoid the discontinuities of starting and stopping the tone. spl_rms = 60; spl_p0...

5ヶ月 前 | 0

| 採用済み

回答済み

My MATLAB code is showing blank plots instead of encrypted and decrypted images. Why? [Help]

You need to convert encryptedImage and decryptedImage back to uint8. This line is converting to double because SBox is double. ...

My MATLAB code is showing blank plots instead of encrypted and decrypted images. Why? [Help]

You need to convert encryptedImage and decryptedImage back to uint8. This line is converting to double because SBox is double. ...

5ヶ月 前 | 0

| 採用済み

回答済み

normalization data to 0-255

format long g A = [linspace(1, 10, 10); flip(linspace(3, 100, 10)); rand(1,10)].'; T = array2table(A, 'VariableNames', {'ID', ...

normalization data to 0-255

format long g A = [linspace(1, 10, 10); flip(linspace(3, 100, 10)); rand(1,10)].'; T = array2table(A, 'VariableNames', {'ID', ...

5ヶ月 前 | 0

| 採用済み

回答済み

Plot line with custom color

This looks a bit jaggedy and dark here, but looks good in my desktop Matlab. If you had read the documentation for plot, you co...

Plot line with custom color

This looks a bit jaggedy and dark here, but looks good in my desktop Matlab. If you had read the documentation for plot, you co...

5ヶ月 前 | 0

| 採用済み

回答済み

i keep getting this error: Error: Function definitions in a script must appear at the end of the file. Move all statements after the function definition to before the ...

You must have some code in your script after the last end that you didn't post. Make sure that the function definition is the v...

i keep getting this error: Error: Function definitions in a script must appear at the end of the file. Move all statements after the function definition to before the ...

You must have some code in your script after the last end that you didn't post. Make sure that the function definition is the v...

5ヶ月 前 | 0

回答済み

Creating a rectangular patch using random numbers

The chances of four random points in 3d being coplanar are virtually zero. The chances of them forming a parallelogram are infi...

Creating a rectangular patch using random numbers

The chances of four random points in 3d being coplanar are virtually zero. The chances of them forming a parallelogram are infi...

5ヶ月 前 | 1

| 採用済み

回答済み

Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parenthe

You are missing the multiplication operator in several places. For example: IndexImg((Orientation >= pi/8 & Orientation < pi/4...

Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parenthe

You are missing the multiplication operator in several places. For example: IndexImg((Orientation >= pi/8 & Orientation < pi/4...

5ヶ月 前 | 0

| 採用済み

回答済み

Is there a MatLab online training course that teaches you how to create and use functions?

There is a module in the Matlab Fundamentals online training that concentrates on functions: https://matlabacademy.mathworks.co...

Is there a MatLab online training course that teaches you how to create and use functions?

There is a module in the Matlab Fundamentals online training that concentrates on functions: https://matlabacademy.mathworks.co...

5ヶ月 前 | 0

回答済み

finding a numeric pattern in a vector

Note that I added an additional test at the end of vec to make sure this handles a multi-digit number in the middle position of ...

finding a numeric pattern in a vector

Note that I added an additional test at the end of vec to make sure this handles a multi-digit number in the middle position of ...

5ヶ月 前 | 0

回答済み

How to extract specific dates from a datetime table?

whos('-file', 'DATE1.mat') whos('-file', 'DATE2.mat') load('DATE1.mat') load('DATE2.mat') whos head(datet) head(B) found_...

How to extract specific dates from a datetime table?

whos('-file', 'DATE1.mat') whos('-file', 'DATE2.mat') load('DATE1.mat') load('DATE2.mat') whos head(datet) head(B) found_...

5ヶ月 前 | 1

| 採用済み

回答済み

How do I use xline() to plot values calculated in a for loop?

Your x is going to be symbolic based on the code you posted (you can verify this by using the whos in the Command Window or by l...

How do I use xline() to plot values calculated in a for loop?

Your x is going to be symbolic based on the code you posted (you can verify this by using the whos in the Command Window or by l...

5ヶ月 前 | 0

| 採用済み

回答済み

What is the previous syntax for this function?

The strcat function has been around for a long time. strcat("Hello", "World")

What is the previous syntax for this function?

The strcat function has been around for a long time. strcat("Hello", "World")

5ヶ月 前 | 0

| 採用済み

回答済み

output of two function results

You need to provide two output variables when you call the function. Note that the names you use when you call the function don...

output of two function results

You need to provide two output variables when you call the function. Note that the names you use when you call the function don...

5ヶ月 前 | 1

回答済み

Why are values not rotated?

P = [1 2]*10^7; % made up data to test with S = [1 2; 2 3]; T = [0 70; 0 100]; plot(S(1,:),T(1,:), S(2,:), T(2,:...

Why are values not rotated?

P = [1 2]*10^7; % made up data to test with S = [1 2; 2 3]; T = [0 70; 0 100]; plot(S(1,:),T(1,:), S(2,:), T(2,:...

6ヶ月 前 | 0

回答済み

Calculate the temperature distr

First of all, format your code (type Ctrl-A then Ctrl-I) in the Matlab editor. Second, add more comments. For example, is m ...

Calculate the temperature distr

First of all, format your code (type Ctrl-A then Ctrl-I) in the Matlab editor. Second, add more comments. For example, is m ...

6ヶ月 前 | 0

| 採用済み

回答済み

Factorial using a for loop

Your code works fine (though I would add semicolons to the end of all lines except the for and end to avoid spewing a bunch of s...

Factorial using a for loop

Your code works fine (though I would add semicolons to the end of all lines except the for and end to avoid spewing a bunch of s...

6ヶ月 前 | 2

回答済み

read several csv files with space in the name format

i = 1; filename2 = strcat('opt.w.matrix.reg. ',int2str(i),'.csv') As you have seen, strcat strips leading and trailing spaces....

read several csv files with space in the name format

i = 1; filename2 = strcat('opt.w.matrix.reg. ',int2str(i),'.csv') As you have seen, strcat strips leading and trailing spaces....

6ヶ月 前 | 0

| 採用済み

回答済み

remove decimals from title when using sprintf

Q=2021; %year x = 0:10; y = x.^2; plot(x,y) grid on title(sprintf('text %d',Q)) % <<< replace %f with %d

remove decimals from title when using sprintf

Q=2021; %year x = 0:10; y = x.^2; plot(x,y) grid on title(sprintf('text %d',Q)) % <<< replace %f with %d

6ヶ月 前 | 0

| 採用済み

回答済み

Error using .^ not enough input arguments

Perhaps you meant this instead % L = integral( sqrt(1+{power(dy/dx),2}),x1,x2); % ^ ^ remove...

Error using .^ not enough input arguments

Perhaps you meant this instead % L = integral( sqrt(1+{power(dy/dx),2}),x1,x2); % ^ ^ remove...

6ヶ月 前 | 0

| 採用済み

回答済み

Most readable syntax to fill table in a for cycle

There probably isn't a significantly cleaner way to do this. See below for a way to suppress the warnings. format short e x =...

Most readable syntax to fill table in a for cycle

There probably isn't a significantly cleaner way to do this. See below for a way to suppress the warnings. format short e x =...

6ヶ月 前 | 0

| 採用済み

回答済み

How do i do x1<=x<=x2 in matlab?

You have to split up the compound condition into two conditions: (x1 <= x) && (x <= x2) If these terms are scalars, that will ...

How do i do x1<=x<=x2 in matlab?

You have to split up the compound condition into two conditions: (x1 <= x) && (x <= x2) If these terms are scalars, that will ...

6ヶ月 前 | 0

| 採用済み

回答済み

Formatting read data from text files

text_data = fileread('Question.txt'); disp(text_data)

Formatting read data from text files

text_data = fileread('Question.txt'); disp(text_data)

6ヶ月 前 | 1

| 採用済み