已回答
Use Value of String Array to name a variable
First, I must say that this does not seem to be a good idea. It is better to store filenames as a separate field and create an a...

5 years 前 | 0

| 已接受

已回答
How to create a meaningful loop to meet certain conditions
Something like this perhaps, A = 100:1:150; % for fixed spacing, this syntax is more readable B = 300:1:350; for i = 1:nume...

5 years 前 | 0

已回答
How can i get sum of the responses of multi input system?
You can call step() with output arguments. See this example A = rand(2); B = rand(2); C = rand(2); D = zeros(2); sys = ss...

5 years 前 | 1

| 已接受

已回答
How Can I Pull A Specific Variable From The Determinant of Matrix?
This shows that MATLAB could not find a closed-form expression to write lambda1 in terms of lambda2. Your equation is nonlinear ...

5 years 前 | 0

已回答
How to save the variable from the workspace into csv or excel file
save() is for saving in a .mat file. You need writematrix() for xls filename='workspace_variable.xls'; writematrix(res, filena...

5 years 前 | 1

| 已接受

已回答
how to fprintf element in matrix using array without using loops
Like this A=randi([-5,5],2,2); B=randi([-10,10],3,4); K=kron(A,B); a=1:6; a2=1:8; [ag,a2g] = ndgrid(a,a2); fprintf('K(%.0...

5 years 前 | 0

| 已接受

已回答
numeric edit field output format
There does not seem to be a direct way. You can use text edit field and use this FEX package: https://www.mathworks.com/matlabce...

5 years 前 | 0

已回答
How do you extract diagonal elements of submatrix matrix?
Are the submatrices in cell array? For example, try something like this n = 9; A = rand(n); k = 3; B = mat2cell(A, k*ones(...

5 years 前 | 0

| 已接受

已回答
How can I find the roots of a two variable function f(x,y)?
Primarily are following two ways. If you have the Symbolic toolbox, you can use solve(): https://www.mathworks.com/help/symboli...

5 years 前 | 0

已回答
need help to plot smooth of 𝑦̂ the least-squares fit to the data, over the range of x-values
You are just plotting the actual points. The y_fitted will be smooth x=[0 .5 1 1.5 2 2.5 3 3.5 4 4.5 5]; y=[0 -5.27 -8.10 -8.4...

5 years 前 | 2

已回答
concatination rows of matrix for making a new matrix
If you want to pack the bits to create a vector of uint64 datatype then try this M = randi([0 1], 1000, 64); % random vector ...

5 years 前 | 0

| 已接受

已回答
Extract one row per group based on column value from table.
Try something like this [grps, vals] = findgroups(T.ID); T_new = splitapply(@(ids, dts, vals) {ids(max(dts)==dts) max(dts) val...

5 years 前 | 0

已回答
Brace indexing is not supported for variables of this type.
fname is a struct, not a cell array. Change the line to data = readmatrix(fnames(idx).name);

5 years 前 | 1

| 已接受

已回答
Using timetable to sort and apply functions to data with a timestep greater than one year
If you mean that instead of regular time steps, e.g., monthly, yearly, etc. You want to use a custom time-step, you can use the ...

5 years 前 | 0

| 已接受

已回答
Second X-Axis on Bottom of Contour Plot?
Check this example ax1 = axes(); ax1.Position = ax1.Position+[0 0.07 0 0]; xlabel('First x-axis'); ax2 = axes(); ax2.Posi...

5 years 前 | 0

已回答
how to flip mirror contour plot horizontally (to flip about 180 degrees)
Are you looking for something like this psi = readmatrix('psi_all.txt'); Z = readmatrix('Z_all.txt'); R = readmatrix('R_all.t...

5 years 前 | 0

| 已接受

已回答
How to find the index of a randomly chosen element of an array
Try this idx = find(a==random_element)

5 years 前 | 1

| 已接受

已回答
Find indices in a structure array by comparing the name
That for-loop is same as channel_Nr = find(contains(Block.name, Name_desiredSignal));

5 years 前 | 0

| 已接受

已回答
Array indices must be positive integers or logical values.
I am fine, hope you are fine too! In MATLAB, there is no implicit multiplication. In the line f22 = ...... There is a missing...

5 years 前 | 0

| 已接受

已回答
How can I generate a sequence of normally distrubuted random variables with a specified mean and variance?
You can use normrnd(): https://www.mathworks.com/help/stats/normrnd.html if you have Statistics and Machine Learning Toolbox. ...

5 years 前 | 1

| 已接受

已回答
Finding different values of a matrix in a single loop
Edit: This is modified to follows the rule as you described in your comments. A = [ 4 5 2 8 3 4 ...

5 years 前 | 1

| 已接受

已回答
Undefined function 'xline' for input arguments of type 'double'.
xline() was introduced in R2018b. If you are using an older release, you will get this error.

5 years 前 | 1

已回答
Why are some of the outputs' first values ​​not equal to zero?
Yes, it is because of matrix 'D'. At t=0, the values of all the states 'x' will be zero, but the value of output 'y' will not be...

5 years 前 | 1

| 已接受

已回答
convert larger image into patches
You can use this FEX package: https://www.mathworks.com/matlabcentral/fileexchange/35085-mat2tiles-divide-array-into-equal-sized...

5 years 前 | 0

已回答
fmincon constraining some variables and not others
"I know that linear inequality constrains should be enforced by defining the system A · x ≤ b, but this forces me to impose a co...

5 years 前 | 1

已回答
What is the function of find()
reward = [1 2 3; 3 4 5; 5 6 7]; cs = 1; Check the output of your code one part at a time >> reward(cs,:) ans = 1 2 ...

5 years 前 | 2

| 已接受

已回答
Plot function is blank
Change the line a=1/t*g; to a=1./t.*g; Read about element-wise operators: https://www.mathworks.com/help/matlab/matlab_prog/...

5 years 前 | 1

| 已接受

已回答
Array dimensions must match for binary array op. How to fix this thanks
Change the line [M, N] = size(input_image); to [M, N] = size(input_image, [1 2]); Also, instead of FT_img = fft2(double(i...

5 years 前 | 0

| 已接受

已回答
Possible to display a series of figures after the batch processing has ended?
One option is to keep saving all the images in a cell array and after the processing is finished, use montage(): https://www.mat...

5 years 前 | 1

加载更多