Solved


Opposite task convert binary numbers array into array of decimal numbers.
Opposite task convert binary numbers array into array of decimal numbers. Example x=[ 11001000 ; 11001001 ; 11001010 ...

5 years ago

Solved


Solve expression II
Solve given expression. alpha=0.1(-x-y-50)/(exp((-x-y-50)/10)-1) beta=5exp((-x+y-60)/20) result=alpha+beta;

5 years ago

Solved


Convert array of decimal numbers into binary numbers array.
Convert an array of decimal numbers into binary numbers array. For example: x = [1 2 3 4 5 6 7 8]; result = [1; 10; 11;...

5 years ago

Solved


Calculate the sum of elements of n*n Hilbert matrix.
Calculate the sum of elements of n*n Hilbert matrix. For example, for n=5: HilbertMatrix = [1.0000 0.5000 0.333...

5 years ago

Solved


Find product of eigenvalues of n*n magic matrix.
Find product of eigenvalues of n*n magic matrix. Example n=3 Matrix= [ 8 1 6; 3 5 7; 4 ...

5 years ago

Solved


Form a square matrix from four square sub-matrices
Create a square matrix, y, from 4 square sub-matrices that will be constructed (x1, x2, x3, x4): y = [x1 x2; x3 x4]; ...

5 years ago

Answered
How can I sum each 3 columns array?
m=movsum(x,3); y=m(:,1:3:end);

5 years ago | 1

| accepted

Answered
Cropping images around the center of an image with a particular size
I=imread('FP00000s323d04u_01.png'); i=I(144:367,144:367,:); imshow(i);

5 years ago | 0

Answered
Too many for loops, how to approach rearranging arrays problem differently?
a=1:10; b=10:19; sa=0;sb=0; for k=2:numel(a) sa=sa+sum(nchoosek(a,k),'all'); sb=sb+sum(nchoosek(b,k),'all'); end

5 years ago | 0

Answered
How can I fix random numbers in a for loop?
t=1:.1:10; for k=1:10 s1=randi(5)*sin(1*t)+randi(5)*sin(2*t); s2=randi(5)*sin(1*t)+randi(5)*sin(2*t); Diff(k)=(s1-s2); e...

5 years ago | 1

| accepted

Solved


Give prime Numbers upto n
You are given a input number x; print all the prime numbers less than equal to x.

5 years ago

Solved


Matrix rotation as per given angle
Given a user defined matrix and angle of rotation, rotate the elements of output matrix as clockwise or anti-clockwise. Angle wi...

5 years ago

Solved


Distance between two GPS Coordinates
A problem that arises when performing geographically weighted regression is determining the distance between GPS coordinates. GI...

5 years ago

Solved


Tridiagonal
Return an n-by-n matrix that has a, b, c as the subdiagonal, main diagonal, and superdiagonal entries in the matrix. Example ...

5 years ago

Solved


Double Deal
*Description* Given an input vector _v_, return the first element as the first output, the second element as the second outpu...

5 years ago

Solved


Toolbox check part 3
In my ongoing quest to highlight obscure parts of MATLAB, the latest challenge is to take 2 string inputs, one a MATLAB toolbox ...

5 years ago

Answered
For loop broken ?
rho = (20-h(n)/1000)/(20+h(n)/1000)*1.225;%h(n) is always going to be zero rho = (20-h(n-1)/1000)/(20+h(n-1)/1000)*1.225;%did y...

5 years ago | 0

| accepted

Answered
How to save for loop output to column vector
No loops needed, although you never defined hbar. fvf= 2888.7; ccm = 3*10^8*100; h = 6.63*10^-34; v1 = ccm*fvf; invAvkg = 1...

5 years ago | 0

| accepted

Answered
Function Approximation and Interpolation
Something like this. f = @(x) exp(-x.^2); x = linspace(-1, 1, 9); G=vander(x); y=f(x); c=G\y'; f1=@(x)polyval(c,x); t=lin...

5 years ago | 0

| accepted

Answered
Finding top and bottom 10% of data
n=round(.1*numuel(yourMatrix)); [~,idx]=sort(yourMatrix); bottom=yourMatrix(idx(1:n)); top=yourMatrix(idx(end-*n+1:end));

5 years ago | 0

Answered
Converting a matrix to string
string(Z);

5 years ago | 0

Answered
How to plot x and y
t=0:.1:100; x=3*t; y=2t; plot(x,y);

5 years ago | 0

Answered
Can someone please debug my code?
You need to use some cell arrays since the number of lines is different in the loops. Also the calculation for Q has something w...

5 years ago | 0

Answered
Apply the same matrix index to another matrix (bootstrap for matrix processes)
g=[]; [a,b]=size(indices); for k=1:b g=[g,vector(repmat(indices(:,k),1,b)+[0:a:(b-1)*a])]; end

5 years ago | 0

Answered
How can I solve an equation with 4 vectors of unequal length?
Use ndgrid() g = 9.80665; mb = 1:0.5:20; r = 0.01:0.01:0.15; omega = 1800:1000:20000; omegarad =...

5 years ago | 1

| accepted

Answered
please help me with this calculus question
No reason to use symbolics. round(sum((-1).^(2:58)./(1:57).^2),4);

5 years ago | 0

Answered
why is my code giving me a parse error
x=0.1; %beats=A(1,30); There is no A defined and you are indexing into it! for k=1:30 A(k)=2*x*(1-x); %need 2*, if you wan...

5 years ago | 0

Answered
When I try to solve this equation, this message appears, how can I solve this problem?
k=2.7904; R=0.20491; syms a Eqn=a./(1+(2*k*(1-a))+(1+(2*k/3)).*(sqrt(3*(1-a))))==R;%messed equation up (need k*(1-a)) s = v...

5 years ago | 1

| accepted

Answered
Using fzero to find values of B for given values of A
A=5:5:25; for k=1:numel(A) fun = @(x) (1-0.5*cos(A(k))-1.2*cos(x)).^2+(0.5*sin(A(k))+1.2*sin(x)).^2 -1; B(k)=fzero(fun,1)...

5 years ago | 1

Answered
Get the position of the next in row and next in column in a matrix
matlab indexing is down and then across. A=[1 0 -2 0 0;2 8 0 1 0;0 0 3 0 -2;0 -3 2 0 0;1 2 0 0 -4]; a=A';%gets your indexing ...

5 years ago | 0

Load more