Answered
Scattered Interpolant possible with multiple sample value vectors?
Please try this: F = cell(8,1); for ii =1:8 F{ii} = scatteredInterpolant(xe,ye,UF(:,ii),'natural'); end

11 years ago | 2

| accepted

Answered
what's wrong with the code?
Try it x= pi/4; n = 2; sum1 = 2; er = 1; while abs(er) > 0.001 m = 2*n-1; sumnew = sum1+(-1)^(n-...

11 years ago | 0

| accepted

Answered
Efficient slicing of cell array?
variant cell2mat(cellfun(@(x)x(:,1:50),C,'un',0));

11 years ago | 1

| accepted

Answered
How to evaluate different expressions of a matrix for multiple variable values?
r1 = @(t,e,omega)[e*[cos(omega*t);e*sin(omega*t)];zeros(1,numel(t))]; e = 50; omega = 20; t=0:0.001:10; ...

11 years ago | 0

| accepted

Answered
calculating the area under curve using cuntrapz or any other syntax
xy =[1.47 1 8.93 2 19.53 3 23.47 4 27.1 5 29.1 6 34.5 7 38.53 8 39.13 9 49.83 10 56.2 ...

11 years ago | 0

Answered
generate random binary matrix under a condition
x = zeros(5,7); s = size(x); x(sub2ind(s,randi([1 5],s(2),1),(1:s(2))')) = 1;

11 years ago | 0

Answered
Problems with cell array
k = c(1:size(c,1)+1:end));% EDIT (diag(c)); or k = c(eye(size(c))>0); out = min([k{:}],[],2);

11 years ago | 0

| accepted

Answered
How to vectorize sum of scaled matrices ? Or is there matlab function for irregular inverse dft ?
A = reshape(exp(1i*[X(:),Y(:)]*[v2;v1])*f(:),size(X));

11 years ago | 1

| accepted

Answered
Concatenate two cell arrays in matlab
A = cell(8,1); A(1:4) = num2cell((1:4)'); numeric array A = zeros(8,1); A(1:4) = (1:4)';

11 years ago | 0

| accepted

Answered
column shuffling of a matrix
A = imread('Untitled.png'); m = size(A); out = zeros(m); m1 = round(m(2)/2); out(:,1:2:end,:) = A(:,1:m1,:); ou...

11 years ago | 0

| accepted

Answered
Indices from Max function to Extract Data
A=[1 2; 3 2; 3 4]; B=[1 2; 3 4; 5 6]; n = 1; [~,I]=max(A,[],n); c ={(1:size(A,3-n))',I(:)}; % EDIT l = n ==...

11 years ago | 0

| accepted

Answered
Repeat matrix element of a given matrix
x = [2 5 3 6 1]; y = x(ceil((1:4*numel(x))/4));

11 years ago | 0

Answered
Export Data from Matlab to Excel
Try it xlswrite('default1.xlsx',[W1,W2],1,'B3:C22');

11 years ago | 1

| accepted

Answered
Determine the minimum value excluding zero
A= [0.025 520 0.027 531 0.029 560 0.031 508 0.033 000 0.035 572 ...

11 years ago | 1

| accepted

Answered
simple question about cell array resizing
out = {cat(1,A{:})}

11 years ago | 0

| accepted

Answered
How can I count the number of elements of a given value in a matrix?
n = floor(min(a)); m = ceil(max(a)); [~,~,lo] = histcounts(a(:,1),n(1):m(1)); [~,~,la] = histcounts(a(:,2),n(2):m(2))...

11 years ago | 0

Answered
How can I find X for given Y value in a fitted curve?
other variant X = arrayfun(@(y)fzero(f50(x)-y,1),Y);

11 years ago | 1

Answered
How can I execute a calculation multiple times using matrix elements as variables?
D = [1 2 3;4 5 6]; out = D(:,1).*cos(D(:,2)+50*D(:,3));

11 years ago | 2

Answered
How can I plot a conditional function?
t2 = 3.07 < t & t <= 7.92; % EDIT t3 = t > 7.92; BH3 = BH2; BH3(t2) = BH3(t2)*.67 + BH1(t2)*.33; BH3(t3) = BH...

11 years ago | 0

| accepted

Answered
How to find a specific row in the matrix and extract it to the new matrix
Z = [1 1 1 2 2 2 3 1 3 1 3 4 4 2 1 3 5 1 1 2 6 2 3 1 7 1 3 4 8 1 1 2 9 2 3 1 10 1 3 4 11 1 1 2 ...

11 years ago | 0

| accepted

Answered
How to find repeated elements , numbers and corresponding values?
a = [1701595 1000 1704973 1000 1704973 1000 1713813 1000 1713812 1000 1713813 1000 1718216 1000 1718217 1...

11 years ago | 0

Answered
Ho w to find the first minimum element in a row
y = [682.8333 399.8160 34.2270 46.1800 107.7035 21.5367]; out = y(find(diff(y)>0,1,'first'));

11 years ago | 1

Answered
how to correlate two data ?
Please read <http://www.mathworks.com/help/matlab/ref/corrcoef.html here>

11 years ago | 0

Answered
cell array of nested cells
let |yourcellarray| - your array out = cat(1,yourcellarray{:});

11 years ago | 0

Answered
Delete rows from and interpolate
x = xlsread('testbyDamith.xls'); n = find(rem(x(:,4),3)==0); x1 = x(n(1):n(end),:); t0 = num2cell(x1(:,1:4),1); t ...

11 years ago | 1

Answered
Help saving the output of a for loop within a function into a vector.
l0 = vectin>lowlim & vectin<uplim; outvec = l0*vectin; numout = nnz(l0);

11 years ago | 0

Answered
Regarding random generation of elements in a matrix.
out = zeros(1,10); out(randperm(10,2)) = 1; or just out = randperm(10) > 8;

11 years ago | 0

Answered
how can i remove elements of matrix that are greater mean value by a factor of 3 times standard deviation?
E(bsxfun(@and,bsxfun(@gt,E,M),S==3)) = nan;

11 years ago | 0

| accepted

Answered
How can i divide a (matrix) into two parts
idx=randsample(300,240); or idx = randperm(300,240); B = A(idx,:); C = A(~ismember((1:size(A,1))',idx),:); ...

11 years ago | 1

| accepted

Answered
Call a function with inputs from different sources
try is it: ff = @(x, d,a) ((x(1)+a*d(1)) + 4*(x(2)+a*d(2)) - 3)^2 +... (2*(x(1)+a*d(1)) + 5*(x(2)+a*d(2)) - 15...

11 years ago | 0

| accepted

Load more