Feeds
已回答
What settings should be done when statement coverage is required?
In the Simulink Configuration Parameters, on the Coverage pane, you can set "Structural Coverage Level" to "Block Execution." Wh...
What settings should be done when statement coverage is required?
In the Simulink Configuration Parameters, on the Coverage pane, you can set "Structural Coverage Level" to "Block Execution." Wh...
8 months 前 | 1
已回答
How to load the function (.m) to the workspace when the simulink run?
It appears that you are using MATLAB R2021a on Windows. My understanding of your issue is that you've moved the model to a diff...
How to load the function (.m) to the workspace when the simulink run?
It appears that you are using MATLAB R2021a on Windows. My understanding of your issue is that you've moved the model to a diff...
3 years 前 | 0
| 已接受
已回答
Why does my plot say undefined variable or function for X2?
Your code returns an undefined function or variable X error, because you try to define Areaofvertical = (Lv*X); before you hav...
Why does my plot say undefined variable or function for X2?
Your code returns an undefined function or variable X error, because you try to define Areaofvertical = (Lv*X); before you hav...
4 years 前 | 0
已回答
Saving a struct property within a class object
classdef testclass properties (GetAccess=public, SetAccess=public) S number end methods ...
Saving a struct property within a class object
classdef testclass properties (GetAccess=public, SetAccess=public) S number end methods ...
4 years 前 | 0
已回答
Calling external function in ode45
function FractionY=ffy(y) Did you save this function as FractionY.m or as ffy.m? Because as it's written, the function is actua...
Calling external function in ode45
function FractionY=ffy(y) Did you save this function as FractionY.m or as ffy.m? Because as it's written, the function is actua...
4 years 前 | 0
已回答
Unable to perform assignment because the left and right sides have a different number of elements.
Where is the definition of T? I am guessing that T is a vector, which makes su = hin*P*T*DX/Ac; a vector, and then you're trying...
Unable to perform assignment because the left and right sides have a different number of elements.
Where is the definition of T? I am guessing that T is a vector, which makes su = hin*P*T*DX/Ac; a vector, and then you're trying...
4 years 前 | 0
已回答
why isn't my code iterating?
Your while loop is converging on a value that is less than 1.2*120. Consider adding an additional parameter that breaks the loo...
why isn't my code iterating?
Your while loop is converging on a value that is less than 1.2*120. Consider adding an additional parameter that breaks the loo...
4 years 前 | 1
已回答
Receiving error vectors must be the same length when trying to plot.
T is 1x1 because none of your if statements are ever true. You want if t <= 144 %do things elseif t > 144 && t <= 358 ...
Receiving error vectors must be the same length when trying to plot.
T is 1x1 because none of your if statements are ever true. You want if t <= 144 %do things elseif t > 144 && t <= 358 ...
4 years 前 | 0
| 已接受
已回答
download 2019b update 3
https://www.mathworks.com/support/search.html/answers/473278-how-can-i-rollback-an-update?q=&fq=asset_type_name:answer%20categor...
download 2019b update 3
https://www.mathworks.com/support/search.html/answers/473278-how-can-i-rollback-an-update?q=&fq=asset_type_name:answer%20categor...
4 years 前 | 0
已回答
Set up a 6 element column vector f such that the value in row n of f is n/B
If I am understanding correctly, n is simply the row number. e.g. row 1 of f is 1/5, row 2 is 2/5 etc.
Set up a 6 element column vector f such that the value in row n of f is n/B
If I am understanding correctly, n is simply the row number. e.g. row 1 of f is 1/5, row 2 is 2/5 etc.
4 years 前 | 0
已回答
How can I change the initial battery charge of the example microgrid in Matlab?
If you right click on the Battery_Simple_Dynamics subsystem, you can go to Mask -> Look Under Mask. Here, you will see that the ...
How can I change the initial battery charge of the example microgrid in Matlab?
If you right click on the Battery_Simple_Dynamics subsystem, you can go to Mask -> Look Under Mask. Here, you will see that the ...
4 years 前 | 1
| 已接受
已回答
How to set a legend with a label for two or more lines?
This isn't a particularly elegant solution, but I think it does what you want. x = linspace(0,0.5); for i = 1:3 y1(i,:) =...
How to set a legend with a label for two or more lines?
This isn't a particularly elegant solution, but I think it does what you want. x = linspace(0,0.5); for i = 1:3 y1(i,:) =...
5 years 前 | 5
| 已接受
已回答
How do I save a figure as the title of the figure?
Assign your title to an object th = title('WT 0HR', 'fontsize', 20); And extract the title string using dot syntax, and use it...
How do I save a figure as the title of the figure?
Assign your title to an object th = title('WT 0HR', 'fontsize', 20); And extract the title string using dot syntax, and use it...
5 years 前 | 0
已回答
Find data between min and max
Something like this? t = linspace(0,2*pi,201); y = sin(t); plot(t,y,'LineWidth',2) grid on hold on minid = find(islocalmin...
Find data between min and max
Something like this? t = linspace(0,2*pi,201); y = sin(t); plot(t,y,'LineWidth',2) grid on hold on minid = find(islocalmin...
5 years 前 | 0
已回答
Can't get tiled graph to show two lines inside of a loop, can anyone help?
I found two issues. One is, your plot commands are inside the nested FOR loop and they need to be outside the first END statemen...
Can't get tiled graph to show two lines inside of a loop, can anyone help?
I found two issues. One is, your plot commands are inside the nested FOR loop and they need to be outside the first END statemen...
5 years 前 | 0
已回答
How can I find index from the cell array and then extract desired value from it.
Hi, Normally this would be easy using cell2mat because it appears each entry of the cell is meant to be a 1x3 array. However, l...
How can I find index from the cell array and then extract desired value from it.
Hi, Normally this would be easy using cell2mat because it appears each entry of the cell is meant to be a 1x3 array. However, l...
5 years 前 | 0
已回答
3x3 matrix with while loop
n = 3; m = 3; A = zeros(n,m); while det(A) == 0 A = rand(n,m); end
3x3 matrix with while loop
n = 3; m = 3; A = zeros(n,m); while det(A) == 0 A = rand(n,m); end
5 years 前 | 0
已回答
quick reference guide for plotting
https://www.mathworks.com/help/matlab/ref/plot.html#btzitot-LineSpec
quick reference guide for plotting
https://www.mathworks.com/help/matlab/ref/plot.html#btzitot-LineSpec
5 years 前 | 0
| 已接受
已回答
input multi workspaces in function
Put the data into one array, pass it into the function, and parse the array inside the function?
input multi workspaces in function
Put the data into one array, pass it into the function, and parse the array inside the function?
5 years 前 | 0
已回答
How can I run Simulink 'Build model' from the command line
I'm not sure if I'm understanding your use case completely, but I think you are looking for sim? sim('modelname.slx'); If that...
How can I run Simulink 'Build model' from the command line
I'm not sure if I'm understanding your use case completely, but I think you are looking for sim? sim('modelname.slx'); If that...
5 years 前 | 0
已回答
Replace all instances of a value with random number
A = [0 1 0 1; 1 0 1 1; 0 0 1 1]; id = A==1; r = rand(1,nnz(id)); A(id) = r;
Replace all instances of a value with random number
A = [0 1 0 1; 1 0 1 1; 0 0 1 1]; id = A==1; r = rand(1,nnz(id)); A(id) = r;
5 years 前 | 1
| 已接受
已回答
How to remove the table size below the table header; e.g., get rid of --> " 1×7 table "
The 1x7 table is not part of the table, it's part of the default display when you type a variable name with no formatting, you c...
How to remove the table size below the table header; e.g., get rid of --> " 1×7 table "
The 1x7 table is not part of the table, it's part of the default display when you type a variable name with no formatting, you c...
5 years 前 | 1
已回答
how to keep labels in matlab with multiplotyyy function ?
x = linspace(1,10,201); y1 = x.^2; y2 = log(x); pyh = plotyy(x,y1,x,y2); legend('x^2','ln(x)') ax = gca; xlabel('x') ax.X...
how to keep labels in matlab with multiplotyyy function ?
x = linspace(1,10,201); y1 = x.^2; y2 = log(x); pyh = plotyy(x,y1,x,y2); legend('x^2','ln(x)') ax = gca; xlabel('x') ax.X...
5 years 前 | 0
已回答
Matrix Shifting: columns to single row
A = [1 2 3; 4 5 6; 7 8 9] B = reshape(A',[1,numel(A)])
Matrix Shifting: columns to single row
A = [1 2 3; 4 5 6; 7 8 9] B = reshape(A',[1,numel(A)])
5 years 前 | 0
| 已接受
已回答
Can the diff function go the opposite direction?
sure, flip your matrix with fliplr or flipud and then run diff
Can the diff function go the opposite direction?
sure, flip your matrix with fliplr or flipud and then run diff
5 years 前 | 0
| 已接受
已回答
"Index exceeds the number of array elements (217)"
If you have 217 rows and you're trying to index row 478 then Matlab will throw an error also, the ,1 will need to be outside ...
"Index exceeds the number of array elements (217)"
If you have 217 rows and you're trying to index row 478 then Matlab will throw an error also, the ,1 will need to be outside ...
5 years 前 | 0
| 已接受
已回答
How to find values in a range and save them to different arrays, repeatedly
target_times= randi(120000,1,64); bins = 10000:10000:120000; c = cell(12,1); c{1} = target_times(target_times < bins(1)); fo...
How to find values in a range and save them to different arrays, repeatedly
target_times= randi(120000,1,64); bins = 10000:10000:120000; c = cell(12,1); c{1} = target_times(target_times < bins(1)); fo...
5 years 前 | 0
| 已接受
已回答
Indexing portions of a vector with array
I had to think about this for a while, but I think that this accomplishes the task you are looking for a = 1:12; id_start = [4...
Indexing portions of a vector with array
I had to think about this for a while, but I think that this accomplishes the task you are looking for a = 1:12; id_start = [4...
5 years 前 | 0