Lessmann
自 2015 起处于活动状态
Followers: 0 Following: 0
Feeds
已回答
How to vectorize for loop of partial arrays?
Hi, this is a vectorized version of your loop. k = ones(1000,1); b = 10*rand(25,1); f = ones(25,1); a = 10*rand...
How to vectorize for loop of partial arrays?
Hi, this is a vectorized version of your loop. k = ones(1000,1); b = 10*rand(25,1); f = ones(25,1); a = 10*rand...
9 years 前 | 0
已回答
How can I delete numbers in a matrix that is not equal to numbers in another matrix?
Hi, you can use logical indexing with the 'ismember' function: A= A(ismember(A,B))
How can I delete numbers in a matrix that is not equal to numbers in another matrix?
Hi, you can use logical indexing with the 'ismember' function: A= A(ismember(A,B))
9 years 前 | 1
已回答
How can I calculate the product of elements in even positions in a vector using a for loop, without using sum or prod built-in functions?
Hi, you can use the modulo function to detect the even positions and then simply multiply the values. z = (50)*rand(1,100...
How can I calculate the product of elements in even positions in a vector using a for loop, without using sum or prod built-in functions?
Hi, you can use the modulo function to detect the even positions and then simply multiply the values. z = (50)*rand(1,100...
9 years 前 | 0
已回答
Out of memory error with 8GB and 64bit
Hi, considering the mentioned size of a matrix, the matrix would occupy ~20GB or ~10GB in the case of single precision. With ...
Out of memory error with 8GB and 64bit
Hi, considering the mentioned size of a matrix, the matrix would occupy ~20GB or ~10GB in the case of single precision. With ...
9 years 前 | 0
| 已接受
已回答
Comparing more than two columns of a matrix using '<' or '>' symbol
Hi, you can achieve this by using B = diff(-A,1,2) < 0 You have to concatenate a column of zeros, so that A and B are ...
Comparing more than two columns of a matrix using '<' or '>' symbol
Hi, you can achieve this by using B = diff(-A,1,2) < 0 You have to concatenate a column of zeros, so that A and B are ...
9 years 前 | 0
已回答
If statement with 2 matrices
Hi, if statements on matrices can often be realized with logical indexing. Assuming the matrix B is of type 'logical', your ...
If statement with 2 matrices
Hi, if statements on matrices can often be realized with logical indexing. Assuming the matrix B is of type 'logical', your ...
9 years 前 | 0
| 已接受
已回答
Why complex arrays take twice as much memory on GPU than on CPU ?
Hi, this behaviour is not a difference between CPU and GPU. It is the general case that the complex nuber uses twice the memo...
Why complex arrays take twice as much memory on GPU than on CPU ?
Hi, this behaviour is not a difference between CPU and GPU. It is the general case that the complex nuber uses twice the memo...
9 years 前 | 0
已回答
Plotting data on a 2d plane with colorbar
Hi, an easy way of doing this is the scatter plot. Use it like this scatter(x,y,[],z,'filled') <</matlabcentral/answe...
Plotting data on a 2d plane with colorbar
Hi, an easy way of doing this is the scatter plot. Use it like this scatter(x,y,[],z,'filled') <</matlabcentral/answe...
9 years 前 | 2
已回答
In an assignment A(I) = B, the number of elements in B and I must be the same.
Hi, your problem is, that the dimensions of Rainfall and CN don't match. Use the the index idx or ~idx on CN. Also the operat...
In an assignment A(I) = B, the number of elements in B and I must be the same.
Hi, your problem is, that the dimensions of Rainfall and CN don't match. Use the the index idx or ~idx on CN. Also the operat...
9 years 前 | 0
| 已接受
已回答
How it is possible to sum these two matrix as a vector?
If I understand you right, this should do it. function [C1,C2] = foo(A,B) C1 = zeros(16,4); C2 = zeros(16,4); i...
How it is possible to sum these two matrix as a vector?
If I understand you right, this should do it. function [C1,C2] = foo(A,B) C1 = zeros(16,4); C2 = zeros(16,4); i...
9 years 前 | 0
| 已接受
已回答
plot a certain x,y values from a large matrix
You can use the colon operator to select a subset of your vector, like plot(x(500:2500),y(500:2500))
plot a certain x,y values from a large matrix
You can use the colon operator to select a subset of your vector, like plot(x(500:2500),y(500:2500))
9 years 前 | 0