Andrew Newell
Followers: 0 Following: 0
A geophysicist who uses MATLAB for most of his modeling. Professional Interests: geophysics
Feeds
已回答
Using AND Operator in “if” statements
The problem is that size returns a vector: size([1 2 3]) ans = 1 3 Instead, use |numel|: if numel([1 2 3])==numel([4 5 6]) &...
Using AND Operator in “if” statements
The problem is that size returns a vector: size([1 2 3]) ans = 1 3 Instead, use |numel|: if numel([1 2 3])==numel([4 5 6]) &...
19 hours 前 | 9
| 已接受
已解决
The Piggy Bank Problem
Given a cylindrical piggy bank with radius g and height y, return the bank's volume. [ g is first input argument.] Bonus though...
3 years 前
已解决
Lambert's W
Matlab cody does not support lambertw. Try to create a lambert's w function yourself. Lambert's W is the function that solves...
3 years 前
已解决
First use of arrayfun() and anonymous function @(x)
Create an anonymous function using @(x) for a parabola equation for the given coefficients stored in s with s(1)x2 + s(2)x +...
3 years 前
已解决
The End of the World
given a date -- represent it in the Maya long count system. <https://en.wikipedia.org/wiki/Maya_calendar> <https://maya.nm...
3 years 前
已解决
Lost days
Given two dates in a particular format, calculate the difference between them.
3 years 前
已解决
Leap Year
According to Gregorian Calender(which is in use now, in many countries),decide whether a given year is a leap year or not. Give...
3 years 前
已解决
Friday or not
I love Friday. Please tell me whether the day is Friday. Dateformat is 'yyyy-mm-dd' or 'dd-mmm-yyyy' or 'mm/dd/yyyy'. Exa...
3 years 前
已解决
Find the day for a date
Today's day and date will be given to you. By utilising that you need to find the day of the old date. (Date will be in DD/MM/YY...
3 years 前
已解决
Friday the 13th
According to superstition, lots of unpleasant stuff happens on Friday the 13th, so you might like to find the next occurence of ...
3 years 前
已解决
Day counter function
Write a function called _day_counter_ that returns the number of Mondays that fell on the first day of the month in a given year...
3 years 前
已解决
Count the days
Count the occurrence of a particular day (e.g. Monday) in a given year.
3 years 前
已解决
How long until the weekend?
Write a function a that takes a date vector as an input and returns the number of hours until the weekend begins. The beginning...
3 years 前
已解决
Days until next NewYear ball drop
Given a date string in the form 'yyyy-mm-dd' or 'yyyy-mm-dd hh:mm:ss', calculate the number of *days* until the dropping of the ...
3 years 前
已回答
How do I generate a random number with beta distribution?
You can use the function betarnd, but you'll need to do some normalizing to get it in the standard form used by MATLAB (see Beta...
How do I generate a random number with beta distribution?
You can use the function betarnd, but you'll need to do some normalizing to get it in the standard form used by MATLAB (see Beta...
3 years 前 | 0
| 已接受
已回答
Newton Raphson - saving all values and using last iteration value as initial for next
Sorry, I just realized that you wanted to save the iterations. Here's how: x = -0.001*ones(6,length(A1)); for i=1:5 x(i+1...
Newton Raphson - saving all values and using last iteration value as initial for next
Sorry, I just realized that you wanted to save the iterations. Here's how: x = -0.001*ones(6,length(A1)); for i=1:5 x(i+1...
3 years 前 | 0
| 已接受
已回答
Newton Raphson - saving all values and using last iteration value as initial for next
O.k. So here is how you do it: x = -0.001*ones(size(A1)); for i=1:5 x = x - f(x)./fd(x); end
Newton Raphson - saving all values and using last iteration value as initial for next
O.k. So here is how you do it: x = -0.001*ones(size(A1)); for i=1:5 x = x - f(x)./fd(x); end
3 years 前 | 0
已解决
Combinations without using nchoosek
You have to generate a matrix with all possible combinations of n elements *taken 2* at a time, *without using nchoosek(1:n,2)* ...
3 years 前
已解决
Rotate Matrix @180 degree
Rotate Matrix @180 degree Example A=[8 1 6; 3 5 7; 4 9 2], then answer would be [2 9 4;...
3 years 前
已解决
Calculate the average value of the elements in the array
Calculate the average value of the elements in the array
3 years 前
已解决
the average value of the elements
Calculate the average value of the elements in the array
3 years 前