Answered
how to find the smallest taxicab number or Ramanujan number like 1729 larger than N?
There are so few taxicab numbers that you should just use a lookup table. l=["2", "1729", "87539319", "6963472309248", "4898865...

3 years ago | 0

| accepted

Answered
Delete rows from cell array in a for loop
for k=1:100 a=yourCell;%just copy yourCell to another variable a(k,:)=[];%deletes row k end

3 years ago | 1

Solved


how to determine is a point is inside, on or outside a polygon?
design function determines whether the point is inside a contour, outside, or lies on an edge (or coincides with a vertex). It r...

3 years ago

Solved


Weave two vectors into one
Weave the two given vectors into one as shown below. Example: If a = [1 1 1] b = [0 0 0] then y = [1 0 1 0 ...

3 years ago

Solved


Polygon Interior Angle Sum
Given the number of sides of a regular polygon, find the sum of interior angles. Return 0 for input for which regular polygon a...

3 years ago

Solved


How many apples
You have x apples I take from you y apples now how many apples you have ?

3 years ago

Solved


Zero or hero
A number will be given as an input. You can be hero if it's not zero. (Just for fun)

3 years ago

Solved


Identifying teenager
Suppose the age of a person is given. If he/she is a teenage, answer is 'yes'. Otherwise, the answer is 'no'.

3 years ago

Solved


Vector indexing: lower than mean
Find all values in a vector lower than the mean of the vector

3 years ago

Solved


Surface area of a sphere
Given the radius of a sphere, find it's Surface area

3 years ago

Solved


How many unique Pythagorean triples?
For a given integer |n|, return all <https://en.wikipedia.org/wiki/Pythagorean_triple Pythagorean triples> that inlude numbers s...

3 years ago

Solved


Tax Calculator
Calculate the tax for a given income. 10% tax is paid for any income up to $2,000. 20% tax is paid for additional income u...

3 years ago

Solved


Find two numbers that add up to the target value
Given a vector A and target n, return the indices of two numbers that add up to n. If there are multiple solutions, return the f...

3 years ago

Answered
How to set stopping condition on time in nested for loop?
tStart = cputime; c=0; while 1 if cputime-tStart>20 break end c=c+1; end c

3 years ago | 0

Answered
How to get the logical index 1 if the cell is missing?
load input.mat ismissing(data{2})

3 years ago | 0

Answered
Going back from cumsum for a matrix
A=round(rand(100,100),4); B=cumsum(A); a=round([B(1,:);diff(B)],4); isequal(A,a)

3 years ago | 1

| accepted

Answered
1x1 datetime cells into plot
Convert to datenum to plot. for k=1:length(yourCell) t(k)=datenum(yourCell{k}); end

3 years ago | 0

Answered
orbit formula graphing orbits
%Orbit One thetadeg = 0:.1:360; h = 51593.15284; mu = 398600; e = 0; r = (h^2/mu)./(1-e.*cosd(thetadeg)); polarplot(deg...

3 years ago | 1

Answered
How to plot data using the sigmoid and hyperbolic tangent functions.
Here is your code with a few corrections. x = xlsread('Lab 4 Data.xlsx','A2:A47')/1000; f = xlsread('Lab 4 Data.xlsx','B2:B47'...

3 years ago | 1

Solved


Miles to go before I sleep
Recently, my car's odometer passed 56789. Given an odometer reading, output how many miles need to be driven to get the next mi...

3 years ago

Solved


That's some divisor you've got there...
Given a positive integer x, calculate the sum of all of the divisors of the number. Please include the number itself in your fi...

3 years ago

Solved


Accessing values in a cell
You are given c, which is a 1xN cell array, and a and b, which are each two 1xM vectors. Your job is to give the bth value in t...

3 years ago

Answered
May I ask how to plot Poisson distribution plot?
https://www.mathworks.com/help/stats/poisson-distribution.html#btz0aet y = 1:9; p = poisspdf(y,47/42); bar(y,p,1)

3 years ago | 0

| accepted

Answered
Trying to extract three values in one column based on a value in other column
newMatrix=[yourMatrix(~isnan(yourMatrix(:,1)),1),reshape(yourMatrix(~isnan(yourMatrix(:,2)),2),3,[])'];

3 years ago | 0

Answered
How to save and read a 3D matrix in MATLAB?
m = 4; n = 3 ; p = 4 ; % dimensions for matrix A = round(rand(m,n,p),4); writematrix(A,'3DMat_4_3_4.txt'); a=reshape(readmat...

3 years ago | 0

| accepted

Answered
Change a variable till a condition is met
SDa = 0.08; SDb = 0.15; x = 0; y = 1-x; p = -1; varptf =@(x,y)x^2*SDa^2+y^2*SDb^2+2*x*y*p*SDa*SDb; v=varptf(x,y); whil...

3 years ago | 0

Answered
function that ouputs the average word length in a string removing all special characters
s = 'i? love? you!'; r=regexprep(s,'[!?"$%&#]','');%whatever special characters m=mean(cellfun(@(x)length(x),strsplit(r,' ')))...

3 years ago | 0

| accepted

Answered
Fitting a data with the best fit
M = [-40 242.118600000000 -39 242.717400000000 -38 239.597400000000 -37 236.149700000000 -36 241.291400000000 -35 243.78920...

3 years ago | 0

| accepted

Answered
Create vector with variable spacing
Use a cell array. PRI = [0.0624 0.054 0.0636]; for k=1:3 P{k}=0:PRI(k):360; end P

3 years ago | 0

Answered
Need help solving this question in MATLAB
Isn't just an integration of the rate? f=@(t)8*exp(-.1*t.^2); FractionRemaing=(100-integral(f,0,24))/100

3 years ago | 0

| accepted

Load more