Answered
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...

9 years ago | 0

Answered
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 ...

9 years ago | 2

Answered
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(...

9 years ago | 0

Answered
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;

9 years ago | 0

| accepted

Answered
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...

9 years ago | 0

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

9 years ago | 0

| accepted

Answered
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: ...

9 years ago | 0

Answered
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), ...

9 years ago | 0

Answered
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...

9 years ago | 0

Answered
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(...

9 years ago | 2

| accepted

Answered
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...

9 years ago | 1

| accepted

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

9 years ago | 1

Answered
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...

9 years ago | 0

Answered
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...

9 years ago | 0

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

9 years ago | 0

Answered
how to draw a checkerboard with 9 squares each with 0.5 dimension?
You cannot create an image with pixels of dimension 0.5. The dimension of a pixel is always 1. Or what do you mean by 'with dim...

9 years ago | 0

Answered
Clear figure content using clf
If you have open a new figure, it is cleared anyway. So there is no difference between figure(); plot() and figure(...

9 years ago | 1

| accepted

Answered
Want to plot a matrix as a 3D histogram or bar chart.
A = rand(9,10); % sample values bar3(A)

9 years ago | 0

Answered
Generate a vector X of 100 independent samples from Gaussian distribution
X = sqrt(3)*randn(100, 1) + 5;

9 years ago | 0

| accepted

Answered
How to declare a pointer to a pointer array?
Hm. I think it would be best to use genuine Matlab to solve your problem, instead of fiddling with pointers. I'd like to do that...

9 years ago | 0

Answered
How to alter the x axis?
Are you sure you mean 10e10 and not 1e10? Otherwise, setting the axes is quite straight forward: y = linspace(200, 10e10); ...

9 years ago | 0

Answered
Access variables in several .mat files
matfile = {'mymatfile1.mat', 'mymatfile2.mat', 'mymatfile3.mat', 'mymatfile4.mat'}; RW(16000,20,4) = 0; % preallocate f...

9 years ago | 1

Answered
Save values in a loop in a vector
I found it a bit hard to understand what your are looking for. As far as I understood, this can solve your problem: p = [1...

9 years ago | 0

Answered
Comparing two matrices and obtain the un-repeated rows ?
A(~ismember(A, B, 'rows'), :)

9 years ago | 0

| accepted

Answered
recursion-Arkermann function- code run but have wrong answer
You use a wrong definition of the Ackermann function. Must read: A(m − 1, 1) if m > 0 and n = 0(!!!);

9 years ago | 0

| accepted

Answered
Hello I am having trouble plotting this convolution. my error is "Vectors must be the same length."
Use conv for convolution. cov computes the covariance matrix.

9 years ago | 1

Answered
how do I delete pre-existing jobs in parpool from remote cluster
Have you tried to exit Matlab and start over?

9 years ago | 0

Answered
confusion matrix in matlab
The ROC framework is for binary classification tasks. And you need a continuous valued output of the classifier, corresponding t...

9 years ago | 0

Answered
rewrite my loop - whats wrong with that loop ?
I think you can rewrite your code as follows: if dir1 == 1 addr = ADDR1; val = 1; else addr = N_SM - ADDR1; v...

9 years ago | 0

| accepted

Load more