Solved


Check if a matrix is a palindrome in all directions
Check if a matrix is a palindrome both vertically and horizontally. You function will return *true* for |[1,2,1]| or |[2,7,2;...

6 years ago

Solved


Find the next binary palindrome number
We all know, a *palindrome* is nothing but a number or character which remains the same after the forward or backward alteration...

6 years ago

Answered
Is there an alternative for the ismember() function in a for loop?
Have you looked at the unique() function? It might work for you. a=unique(A,'rows','stable');

6 years ago | 0

Answered
How to create a tree ??
Matlab has good documentation, see: doc ClassificationTree doc RegressionTree

6 years ago | 0

Solved


Find the sum

6 years ago

Answered
Newton Raphson Method - how to return errors of each iteration in arrays
I would pull the calculations outside the loop. for k = 1:MaxIter fz = feval(f, iter(k)); dfdx = fz / (feval(f, iter(...

6 years ago | 0

| accepted

Answered
I need help with Monte Carlo Simulation
Not sure if this helps: alpha_1 = 1.25; alpha_2 = 1.5; dead = randn(100000,4); live = evrnd(1,0.5,100000,4); Rn=@(phi)(alph...

6 years ago | 0

Answered
get the regular interval x-value in data set
You should look at interp1() function.

6 years ago | 0

Answered
why are if statements not working?
Price=[199.54 195.89 195 192 193.29 197.09 197.78 190.34 189.55 193.30... 196 194.60 193.63 193 193.77 195.23 193.97]; Tot...

6 years ago | 0

Answered
How to find the intersection point of two curves and the corresponding coordinates
y = 1.4; y1 = (y-1)/2; y2 = (y+1)/2; M1 = 3.5; h_ = @(m)(1+y1*(3.5^2))./(1+y1*(m.^2)); s_ = @(m)((y1/y)*log((m.^2)/(3.5^2))...

6 years ago | 1

| accepted

Answered
Use while loop in equation
C=@(q)sum((1:k).^q.*alpha)/factorial(q)-sum((1:k).^(q-1).*beta)/factorial(q-1); q=1:100; c=arrayfun(@(x)C(x),q); plot(q,c);

6 years ago | 0

Answered
How can I solve it and make a graph for it
odefun=@(x,u)[u(2);(sin(x)-2*u(2)-7*u(1))/3]; tspan=[0 2*pi];%assumed interval for x uzero=[0 0];%not sure what your boundary ...

6 years ago | 0

| accepted

Answered
How to load files on a loop
f=20:1020; for k=1:length(f) fileName=sprintf('x.%04d.FIT',f(k)); a{k}=fitsread(fileName); end

6 years ago | 0

Answered
How to define minimum value matrix?
[~,idx]=min(A,[],2);

6 years ago | 0

| accepted

Answered
display voronoi diagram with multi-robot environment
Try using the clf command between each plot for clf; plot(x,y); end

6 years ago | 0

Answered
newton's method plotting
Something like this: f=@(x)sin(x)-x.*cos(x); fp=@(x)cos(x)+x.*sin(x)-cos(x); x=-3:.01:3; plot(x,f(x)); %% Newton's Method ...

6 years ago | 0

Answered
How to work with arrays with values of Log(0)?
a=log(initialArray); idx=initialArray~=0; a(idx)=5*a(idx);%other calculations only perform on non-zero values of initial array...

6 years ago | 0

Answered
plotting a function with input and output
Main script t=0:.01*pi:20*pi; [x,y]=bird(t); plot(x,y); function function [x,y]=bird(t) x=sin(t).*(exp(cos(t)) -2*cos(4*...

6 years ago | 1

Answered
Finding the mins and the maxes of an array with altering signs.
Do you have the Signal Processing Toolbox? [~,idx]=findpeaks(abs(yourArray));

6 years ago | 0

Answered
function of m and t solution plot
t=-5:0.01:5; n=20; hold on; for m=1:20 y=(t.^m)*m^2./(exp(m*t)-exp(-m*t)); plot(t,y) end

6 years ago | 1

| accepted

Answered
How can i find a variable that is in the infinite series?
Deff=(2.02)*10^(-10); t=22320; a=0.1425; n=1:100000; Ser = @(L) sum(1./(2*n-1).^2.*exp(-(2*n-1).^2*pi^2*Deff*t/4/L^2)); l= ...

6 years ago | 1

| accepted

Solved


'Absolute value'
Create a function called own_abs, which is the absolute number entered as the input return value.

6 years ago

Solved


Adding Numbers
Add the input numbers to the original.

6 years ago

Solved


Determine given vector is even or odd
Find the numbers of the input vector is odd or even then replace even with 1 and odd with 0 Example x = [ 3 3 4 6 1] ...

6 years ago

Solved


For a rectangle, if x is the length and 2x is width. Then find out x from the area of the rectangle?
For a rectangle, if x is the length and 2x is the width. Then find out x from the area of the rectangle? if the area is equal...

6 years ago

Solved


How to calculate the length of a triangle's side given two angles and one side
You are given a triangle with angles alpha, beta and gamma and sides a opposite alpha, b opposite beta and c opposite gamma. ...

6 years ago

Solved


convert between ascii and characters
I have seen multiple problems like this but none of them have a robust test suite associated with them. The first input C is ...

6 years ago

Solved


Find my secret function III
only write a function gives you an outputs as expls: input: x=2 ------->>> Output: Y=1 input: x=100 ------->>> Output: Y=...

6 years ago

Solved


square root
Find square root of given number

6 years ago

Solved


square of a number
find square of a given number

6 years ago

Load more