Answered
Substituting many symbolic variables with one vector to create function handle
syms B C f = matlabFunction(B + C,'vars',{[B C]});

13 years ago | 1

| accepted

Answered
How to make an endless calculated matrix?
A = [2 3; 4 5; 6 7]; B = sum(A,2); A(end+1,:) = [4 9] B(end+1,:) = sum(A(end+1,:),2); ADD fun = @(x)sqrt(s...

13 years ago | 1

| accepted

Answered
how can i add each element in array to a fixed matrix
out = bsxfun(@plus,M,reshape(A,1,1,[])); M0 = num2cell(out,[1 2]); [M1,M2,M3] = M0{:};

13 years ago | 0

Answered
calculate distance using the below equation
dataMatrix = randi([-10,10],10,5); queryMatrix = randi([-10 10],1,5); d = bsxfun(@(x,y)abs(x - y)./(abs(x) + abs(y))...

13 years ago | 2

Answered
How to solve transcendental equations in matlab
syms t; s = 160750000./(t.*t.*t) - exp(-12993.03./t)'; v = double(solve(s)); out = real( v( abs( imag(v) < eps(norm(v...

13 years ago | 1

Answered
Insert data into the right index
for cell array A = {1 3 5 7 9; NaN NaN NaN NaN NaN}; B = {1 5 9; 'x' 'y' 'z'}; A(2,is...

13 years ago | 0

Answered
Matlab graph doesnt look right...not a sinusoid...
function out = qtsolver(x) f = {@(t)2*t-.8*sin(2.5*t),... @(t)4*pi-2*t-0.8*sin(2.5*t)-1.6*cos(2.5*t),... ...

13 years ago | 0

Answered
matrix operation make matrix
A = rand(64,4); K = reshape([(1:5)';2;2;2]*ones(1,8),[],1); B = 2*(K - A(:,1));

13 years ago | 0

Answered
looking condition in matrix
a = [ 2 9841 5 4 2 1;3 79463 1 3 1 0;3 79463 4 3 1 0;3 79463 5 3 1 0;3 79463 1 3 2 0;3 79463 4 3 2 0;3 79463 5 3 2 0;3 79463 1...

13 years ago | 0

Answered
How to divide Vectors of different length?
c = a./kron(b,[1 1 1 1]);

13 years ago | 0

Answered
How to reorder cell array columns based on the order of a vector matrix, while keeping rows intact in Matlab?
m = [5 8 3 6 2 1 7 4 8 4 2 7 1 3 6 5 5 4 3 2 1 7 8 6 1 7 8 5 6 4 ...

13 years ago | 0

Answered
how to combine 2 matrix at once with loop process..?
sa = size(A,1); out = accumarray([A(:), repmat((1:sa)',2,1)],B(:),[size(data,1) sa]); or sa = size(A,1); sd = si...

13 years ago | 0

| accepted

Answered
i can't run this program , the output is (Saturation: LinearInterval: [NaN NaN]), i don't know the meaning of the ouput
x=input('type of formation=','s'); switch x case 'sandformation' f=.62/Q^2.15; case 'compacte...

13 years ago | 0

| accepted

Answered
Filtering the Content of an Array
ABCD = [1 3 2 3 1 4 1 2 1 3 3 5 2 6 1 4 2 5 4 3 ...

13 years ago | 1

| accepted

Answered
Conditioning data to match dimensions
A = rand(10,1); B = rand(130,1); C = randi(500,130,1); a1 = A(1:8); [~,idx] = min(abs(bsxfun(@minus,B,a1.')));...

13 years ago | 0

| accepted

Answered
How to use a function for multiple sets of numbers with a single command?
k = diff(A); D = hypot(k(:,1),k(:,2)); % I am corrected after Sean's comment. On Ciuban's comment. Try used function ...

13 years ago | 1

| accepted

Answered
How to count certain characters in a word?
a = ('a':'d')' b = 'matlabprogram' out1 = [cellstr(a), num2cell(histc(b,a)')]

13 years ago | 2

| accepted

Answered
How can I sort an array of repeating elements
a = [10 670.0 14 670.0 15 670.0 385 668.0 431 668.0 432 668.0 440 668.0 441 668.0 442 668.0 ...

13 years ago | 0

Solved


Is it an Armstrong number?
An Armstrong number of three digits is an integer such that the sum of the cubes of its digits is equal to the number itself. Fo...

13 years ago

Solved


Generate a NaN...on purpose
The goal is to create a function that will return a single "NaN" without using the nan function. I am interested to see how many...

13 years ago

Answered
How to join the elements of char array?
a=[61 62 63 64 65] out = sprintf('%d',a)

13 years ago | 1

Solved


Spiral Matrix
for a given integer n>=3, generate a matrix of nxn such that the value n^2 is at bottom left and its decreasing towards center ...

13 years ago

Answered
compare elements of the same array
n = 10; xm = 40; ym = 60; ij = [randi(xm,n,1), randi(ym,n,1)]; d = bsxfun(@minus,ij,permute(ij,[3,2,1])); d...

13 years ago | 0

| accepted

Answered
Convert the variables x1, x2,... in an anonymous function to x(1,:) ,x(2,:).....
x = randi([-5 5],2,10); % this is your data xc = num2cell(xc,2); out = f(xc{:});

13 years ago | 1

Answered
arranging a matrix data
Ao = reshape(reshape(A,3,[])',[],1);

13 years ago | 0

Answered
how to interchange array elements
x = [11 12 13 14 15]; y = x; y([end,1]) = y([1,end]);

13 years ago | 2

Solved


kmph to mps
convert kilometer per hour to meter per second

13 years ago

Answered
Integral operator in a for loop
v = -5:.1:5; f = @(y)sqrt(y)./(1+exp(y./v)); q = integral(f,0,inf,'ArrayValued',true);

13 years ago | 2

Solved


THE CALCULATOR OF LOVE
In honor of Valentine's Day, program a love calculator that figures out the percentage of compatibility between two people using...

13 years ago

Load more