已回答
Elimination of rows in array
A(A(:,1)+A(:,2) < A(:,3) | A(:,1)+A(:,2) > A(:,4), :) = [];

8 years 前 | 0

| 已接受

已回答
setting the position of the legend
The height of the box is the fourth parameter of the position. To reduce the size you can do the following: p = leg.Positio...

8 years 前 | 0

已回答
How to make this complicated array
x = 5; y = 8; a(x,y) = 0; a([1:x 2*x:x:y*x y*x-1:-1:x*(y-1)+1 x*(y-2)+1:-x:x+1]) = 1:2*x+2*(y-2);

8 years 前 | 0

已回答
Comparing a number matrix to certain values and storing it in another array / matrix
R = 5*rand(4); A = zeros(size(R)); A(R>=1 & R <= 2) = 1; B = zeros(size(R)); B(R>=3 & R <= 4) = 2;

8 years 前 | 0

已回答
How to replace name with number
[~, ~, xnum] = unique(x, 'stable')

8 years 前 | 0

已回答
How to change the language of 2015b (32bit) from english to chinese?
<http://de.mathworks.com/help/matlab/internationalization.html>

8 years 前 | 0

已回答
Creating file names for save command
file_dir = 'C:\Users\mydir'; datestamp=char(datetime('now','TimeZone','local','Format','yyyyMMdd_HHmmss')); file_name...

8 years 前 | 0

已回答
How to assign two values randomly among 2 variables?
idx = rand(100,1); sensor1 = c1; sensor1(idx>0.5) = c2; sensor2 = c1; sensor2(idx<=0.5) = c2;

8 years 前 | 0

已回答
Find a pair of elements in a 3d matrix
Logical index: idx = A(:,:,1) == 0 & A(:,:,2) == 0; if you prefer a single index, you can use idx2 = find(idx); if...

8 years 前 | 0

| 已接受

已回答
optimization to get the least ratio of variables for two functions
You get the index of the minimum ratio A/B using [~, idx] = min(A./B);

8 years 前 | 0

已回答
How to calculate compound interest?
If you have amount A at an interest rate of r, you have after one month A + rA = A(1 + r) after two months A(1+r) + ...

8 years 前 | 0

已回答
How can I create shortcuts to layouts
You can set Shortcuts under Matlab > Preferences > Keyboard > Shortcut, but only for some pre-defined actions; changing the layo...

8 years 前 | 0

已回答
Save multiple images in a folder
You have to use a new name for each image; e.g., for your i'th image: filename = sprintf('myimage%02d.png', i);

8 years 前 | 0

已回答
monotone colored matrix with gridlines
Th showing a gray matrix is easy: I = 0.8*ones(10,10); imshow(I) But removing the axis but keeping the grid is not, b...

8 years 前 | 0

已回答
Why is the factorial of 0 equal to 1?
"In mathematics, an empty product, or nullary product, is the result of multiplying no factors. It is by convention equal ...

8 years 前 | 2

已回答
how to count number of repeating's in data series.
N(i) is the the number of occurrences of series of i numbers in A: N = zeros(numel(A), 1); i = 1; while(i) < numel(...

8 years 前 | 0

已回答
Replace missing elements in an array with NaN
You can add the needed number of NaNs to the filterindex; filterindex(end+1:numel(scanindex) = NaN;

8 years 前 | 0

| 已接受

已回答
i am trying to replace one column with another in dataset?
Probably the size of your variables are not as descripted. Otherwise it works as expected: Load_DATA = rand(374, 14); Da...

8 years 前 | 0

已回答
change even column values only
A = ones(20); A(:,mod(1:20, 2) == 0) = -1;

8 years 前 | 0

| 已接受

已回答
I am having trouble with "Index exceeds matrix dimensions"
If you have MaxColumns, and c runs from 1:MaxColumns, you try to get c + 1, which is MaxColumns + 1, so you get the error: ...

8 years 前 | 0

已回答
Extract variable in nested for loop that otherwise gets replaced
p=rand(....) h=rand(....) HCPV=p.*h; for i = 1:100 for j = 1:29 cum_CO2inj(i,j) = function(p(i), ...

8 years 前 | 0

已回答
Use of max iteratively on a cell
I think that a main problem is who to compute the max values. You can compute the max of each cell as follows: M = cellfu...

8 years 前 | 0

已回答
Vectorisation of a simple for loop
A = [1 1 0 0 ; 1 1 1 0 ; 0 1 2 0; 1 0 0 1]; Q = cell2mat(arrayfun(@(i) A^i, 1:9, 'Uni', false)); Q = [zeros(1, 4); reshape(...

8 years 前 | 2

| 已接受

已回答
How to rewrite matrix ‘Y’ as matrix ‘A’?
You can also use for-loops: for j = 1:size(Y, 1) for i = 1:size(Y,2) A(i+(j-1)*size(Y,2),(1:i)+sum(1:i-1)) = Y(j,1...

8 years 前 | 1

| 已接受

已回答
how to save data from for loop in a matrix ??
for i=1:10; a(i)=i+5; end

8 years 前 | 1

已回答
How to run matcont in Matlab 2015b in OS El Capitan (Macbook)?
Have a look at Ken Attwell's answer in <http://de.mathworks.com/matlabcentral/answers/243868-mex-can-t-find-compiler-after-x...

8 years 前 | 0

已回答
macOS Sierra & Matlab 2013a
No. In fact, no Matlab version with non-United States regions and locales seems to be currently supported. I received the fol...

8 years 前 | 0

已回答
deleting rows in a matrix?
new_x = x(unique(x2),:);

8 years 前 | 0

加载更多