Answered
How to Concatenate two matrix's each elements ?
A = [ 1 2 3; 4 5 6; 7 8 9]; B = [ 1 2 3; 4 5 6; 7 8 9]; str2double(strcat(arrayfun(@num2str,A,'un',0),arrayfun(@num2s...

10 years ago | 0

Answered
maximum and minimum of each columns of a cell array
d = cat(3,Data{:}); datamin = squeeze(min(d))'; datamax = squeeze(max(d))';

10 years ago | 1

Answered
converting to cell to matrix- not working
out = [TestingInterp(2).IGripForce{1:10}]

10 years ago | 0

Answered
Finding the maximum positive real number in a array of complex numbers?
out = max(real(P)) may be so out = max(p(image(p) == 0))

10 years ago | 0

| accepted

Answered
I want to design a loop that gives symbolic outputs?
>> syms x >> f = (1:5)'*x - 1

10 years ago | 0

| accepted

Answered
Changing Matrix value at odd position of row with reference to a certain column
A=[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 1 1...

10 years ago | 0

| accepted

Answered
Copy matrix column with refer to secondary column.
A = [1,2,3,0; 4,5,6,0; 7,8,9,0]; B = [4,5,6,3]; A(ismember(A(:,1:end-1),B(1:end-1),'rows'),end) = B(end);

10 years ago | 0

| accepted

Answered
Matrix Zero padding for filter (image processing)
a = ones(5); out = zeros(size(a)*2-1); out(1:2:end,1:2:end) = a;

10 years ago | 0

| accepted

Answered
How can I return the values of a loop
n = 5; k = tril(((1:n)'*ones(1,n+1)).^2+(1:n)'*(0:n)+(ones(n,1)*(0:n)).^2,1); with |for..end| loop n = 5; k = ze...

10 years ago | 1

Answered
flow redirection in an array
data= [2 1 3 4 2 1 10 4 2 1 10 4 1 3 10 10 1 2 10 10 ...

10 years ago | 0

Answered
How can I deal spesific value and add constraint?
ΠΆ = [1 3 2 1 3 1 4 4 5 1 6 1 7 1 8 1 9 1 10 ...

10 years ago | 0

Answered
How can I write the code of the matrix calculations ?
X = [1 3 5 2 4 1 4 6 2]; [~,ii] = sort(sum(X,2)); B = X(ii,:); NewOne = B + bsxfun(@times,rand(size(X,1),1)...

10 years ago | 0

| accepted

Answered
Roots of function - Fzero error
>>fun0 = @(x) 1 - 3/4*x; >> fzero(fun0,1) ans = 1.3333 >>

10 years ago | 2

| accepted

Answered
how to take first some numbers from sequence?
y = x(1:s)

10 years ago | 1

Answered
how delete empty fields in a struct
out = {t(~cellfun(@isempty,{t.places})).places}; t = cell2struct(out,{'places'},1); or jast t = t(~cellfun(@isempty...

10 years ago | 2

| accepted

Answered
Repeat element n for m times with n,m=vectors
x = cumsum(rep); m = zeros(x(end),1); m(x - rep +1) = 1; out = val(cumsum(m));

10 years ago | 0

Answered
Extracting data from cell
% z - your cell array. x = regexp(z,'[\+\-]?\d+\.\d+$','match'); x = [x{:}]'; out = str2double(x);

10 years ago | 1

| accepted

Answered
divide a vector in subvectors
A = randi(12,27,1); % - your vector M = 4; out = reshape([A;nan(mod(-numel(A),M),1)],M,[]);

10 years ago | 0

Answered
How to substitute some elements from a vector
Y = X; Y([diff(Z(:))~=0;false]) = 0

10 years ago | 2

| accepted

Answered
how can i negative all rows in a matrix?just rows
Let |a| - your array a = [-4 0 1 -2 -3 -3 -5 -5 -2 -1 3 2 -3 1 0 ...

10 years ago | 0

Answered
How can I pick random numbers in a matrix?
Customers.Gender = randi([0,1],3000,1); Customers.Age = randi([21,85],3000,1); Customers.Insurance_risk = randi(10,3000,...

10 years ago | 0

| accepted

Answered
How to count no. of time state occur in sequence and then divide by sequence no.?
a =[1,3,3,1,2,1,4,2,3,1,4,2,4,4,4,3,1,2,5,1]; [a1,~,c] = unique(a); out = prod(accumarray(c,1)/numel(a));

10 years ago | 0

Answered
row addition on matrix
C = sum([A;B]);

10 years ago | 0

| accepted

Answered
How can i display a vector as a result of a for loop ?
ii=0:200:50000; n = numel(ii); mn = zeros(n,1); for jj = 1:n v = -ii(jj).*x(:,3); mn(jj) = (max(v)-min...

10 years ago | 0

| accepted

Answered
How to use if-then with matrix indices
n = 50; z = ones(n)*8; z(:,1) = 4; z(eye(n)>0) = 4;

10 years ago | 0

Answered
Average all variable in the same Longitude and Latitude for Excel
|xlsxfile.xlsx| - your xlsx-file with tible with size [275653x6 ] A = xlsread('xlsxfile.xlsx'); [a,~,c] = unique(A(:,1:2...

10 years ago | 0

| accepted

Answered
Create a new matrix of the old matrix
m = size(A,1) - 1; B = flip(spdiags(A,-m:m),2); back m = size(B,1); A = zeros(m); B1=B'; A(:) = B1(flip(sp...

10 years ago | 1

Answered
how to do the latitudinal average from a matrix?
out = squeeze(mean(m,2))

10 years ago | 0

| accepted

Answered
Count the length of repeated value sets in an array?
x = [1 0 0 1 1 1 0 1 0 1 1 0 0 0]; t = cumsum(diff([0;x(:)])==1).*x(:); out = accumarray(t(t>0),1); or t = ...

10 years ago | 0

Answered
Error using * Inner matrix dimensions must agree
maybe so? h=abs((j*w*R*c)./((j*w*R*c)-(w .* w*L*c)+1));

10 years ago | 0

Load more