已回答
Using Simpson's rule to integrate function
OK. now I understand. I prefer to code an integration loop as follows; For the trapezoidal solution: StartTime = 0; EndTime ...

7 years 前 | 1

| 已接受

已回答
I need to write a program that defines whether a string is a PALINDROME or not WITHOUT using fliplr, reverse or similar commands. Can anyone help with that ?
A palindrome is a word or phrase that is exactly the same forward and bacward. I would use a loop to compare the first characte...

7 years 前 | 0

已回答
my newton raphson nested while function is not iterating well. What do I do?
I haven't spent the time to understand all of your code, but one thing jumps out at me from the start. Inside the while loop, y...

7 years 前 | 0

| 已接受

已回答
How can i create xyz coordinant from pan-tilt system angles.
It seems that you want to convert from spherical coordinates to Cartesian coordinates. You have pan angle (azimuth) and a tile ...

7 years 前 | 0

| 已接受

已解决


Read a column of numbers and interpolate missing data
Given an input cell array of strings s, pick out the second column and turn it into a row vector of data. Missing data will be i...

7 years 前

已回答
Simpson Rule issue - Approximation worsens as n increases
I have not tried to run your code, but at first glance I see a typo in the code. sum=sum+((b1-a1)/2)/3*(f(a1)+4*f((b1-a1)/2...

7 years 前 | 2

| 已接受

已回答
How to convert [-90 90] range of elevation angel in imgradient3 to [0 , 180]?
I think that if you want to convert the range -90 to +90 to 0 to 180, all you need to do is add 90 to each value. Similarly,...

7 years 前 | 0

已回答
runge kutta vs ode
You are very close. In your Runge-Kuta solution, you specified Y0 = 5, Y(1)=5; but in your ode23 solution, you specifi...

7 years 前 | 0

| 已接受

提问


Why does this data file cause Matlab to lock-up?
I just spent the day trying to figure out why Matlab was locking up and not responding. It turns out that deleting a large data...

7 years 前 | 1 个回答 | 0

1

个回答

已解决


Sum Rows
Sum the same indexed (unique) rows. Examine the test suite. Related Challenge - <http://www.mathworks.com/matlabcentral/cody/...

7 years 前

已回答
How to normalize a matrix such that each column sums equal 1
[row, col] = size(A); for i=1:col P(:,i)= A(:,i)/sum(A(:,i)) end

7 years 前 | 1

已回答
how to find the bottom peaks in the graph?
Here is a similar problem. To find the bottom peaks, just change one line from if(D(i) >0 && D(i+1)<0 to if(D(i)<0...

7 years 前 | 0

已回答
Plot 2D graph
Put all the graphs on a single figure: x=-2*pi:0.04:2*pi; figure; plot(x,sin(x),'r'); hold on; plot(x,2*sin(x),...

7 years 前 | 0

| 已接受

已回答
How to plot in 3d line to multiple point from origin?
How about this: A = 3x3 matrix figure; for i=1:3 px=[0, A(i,1)]; py=[0, A(i,2)]; pz=[0, A(i,3)]; ...

7 years 前 | 0

已回答
comparing consecutively numbers to find the peaks of a function
I assume that the points are Y is a function of X. You have a vector Y(600) and a vector X(600) and you want to find the relati...

7 years 前 | 1

| 已接受

已回答
Help with my fibonacci sequence code
This is how I did it. This function will give the nth number in the Fibonacci sequence: function f=fib(n) s=[1, 1]; ...

7 years 前 | 1

| 已接受

已解决


Nearest Numbers
Given a row vector of numbers, find the indices of the two nearest numbers. Examples: [index1 index2] = nearestNumbers([2 5 3...

7 years 前

已解决


Counting Money
Add the numbers given in the cell array of strings. The strings represent amounts of money using this notation: $99,999.99. E...

7 years 前

已解决


Interpolator
You have a two vectors, a and b. They are monotonic and the same length. Given a value, va, where va is between a(1) and a(end...

7 years 前

已回答
How can i measure Angle in 3-D?
The link in the answer by Aquatris is not working for me. The angle between any two lines is given by the dot product. Def...

7 years 前 | 0

| 已接受

已回答
Y=4x+7
7

7 years 前 | 0

| 已接受

已解决


Finding Perfect Squares
Given a vector of numbers, return true if one of the numbers is a square of one of the other numbers. Otherwise return false. E...

7 years 前

已解决


Summing digits
Given n, find the sum of the digits that make up 2^n. Example: Input n = 7 Output b = 11 since 2^7 = 128, and 1 + ...

7 years 前

已解决


Bullseye Matrix
Given n (always odd), return output a that has concentric rings of the numbers 1 through (n+1)/2 around the center point. Exampl...

7 years 前

已解决


Find all elements less than 0 or greater than 10 and replace them with NaN
Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN. Example: Input ...

7 years 前

已回答
how to generate n dimensional lookup table, n=5, in simulink?
Personally, I would make it an S-function and program it in C++.

7 years 前 | 0

已解决


Return the largest number that is adjacent to a zero
This example comes from Steve Eddins' blog: <http://blogs.mathworks.com/steve/2009/05/27/learning-lessons-from-a-one-liner/ Lear...

7 years 前

已解决


Find the longest sequence of 1's in a binary sequence.
Given a string such as s = '011110010000000100010111' find the length of the longest string of consecutive 1's. In this examp...

7 years 前

已解决


Find the numeric mean of the prime numbers in a matrix.
There will always be at least one prime in the matrix. Example: Input in = [ 8 3 5 9 ] Output out is 4...

7 years 前

已解决


Angle between two vectors
You have two vectors , determine the angle between these two vectors For example: u = [0 0 1]; v = [1 0 0]; The a...

7 years 前

加载更多