Answered

Call variables in for loop

To do this like you're attempting requires the use of the eval function, but be very careful in its use. Google 'eval matlab' fo...

Call variables in for loop

To do this like you're attempting requires the use of the eval function, but be very careful in its use. Google 'eval matlab' fo...

fast 10 Jahre ago | 0

| accepted

Answered

Measuring and Changing

if p1 and p2 are 2 element vectors: 1: d1 = sqrt(sum((p1-p2).^2)); 2: No explanation should be required. 3: d...

Measuring and Changing

if p1 and p2 are 2 element vectors: 1: d1 = sqrt(sum((p1-p2).^2)); 2: No explanation should be required. 3: d...

fast 10 Jahre ago | 0

Solved

Tell me the slope

Tell me the slope, given a vector with horizontal run first and vertical rise next. Example input: x = [10 2];

fast 10 Jahre ago

Solved

Bottles of beer

Given an input number representing the number of bottles of beer on the wall, output how many are left if you take one down and ...

fast 10 Jahre ago

Answered

Projectile connected by springs model

This is probably the 3rd or 4th submission of this same exact problem. Please review the question guide: <http://www.mathwork...

Projectile connected by springs model

This is probably the 3rd or 4th submission of this same exact problem. Please review the question guide: <http://www.mathwork...

fast 10 Jahre ago | 0

Answered

To solve double integral

try using quad2d: <http://www.mathworks.com/help/techdoc/ref/quad2d.html>

To solve double integral

try using quad2d: <http://www.mathworks.com/help/techdoc/ref/quad2d.html>

fast 10 Jahre ago | 0

Question

plot data in from structure of data points with limits

I have a structure of datapoints, each of which is a structure of variables. I have created a simple function that will do a sca...

fast 10 Jahre ago | 0 answers | 0

Answered

Numerical Inputs to Solve and Using the Output value

The problem may be that you're expecting a single value, but solve will return 2 values because it's actually quadratic. What...

Numerical Inputs to Solve and Using the Output value

The problem may be that you're expecting a single value, but solve will return 2 values because it's actually quadratic. What...

fast 10 Jahre ago | 0

Answered

Loop Problem

You have two loops when you just need one. Essentially you're looping through the entire binary variable for each p value, but e...

Loop Problem

You have two loops when you just need one. Essentially you're looping through the entire binary variable for each p value, but e...

fast 10 Jahre ago | 0

| accepted

Answered

Surface plot problem,

You're not feeding the proper inputs into surfc. surfc(x,y,z,c) requires x be a vector of length(n), y a vector of length(m), si...

Surface plot problem,

You're not feeding the proper inputs into surfc. surfc(x,y,z,c) requires x be a vector of length(n), y a vector of length(m), si...

fast 10 Jahre ago | 0

| accepted

Solved

Project Euler: Problem 6, Natural numbers, squares and sums.

The sum of the squares of the first ten natural numbers is, 1^2 + 2^2 + ... + 10^2 = 385 The square of the sum of the first ...

fast 10 Jahre ago

Answered

Help with plotting multiple line complete with legends.

Tim, See a previous answer that I helped a guy out with here: <http://www.mathworks.com/matlabcentral/answers/29799-adding...

Help with plotting multiple line complete with legends.

Tim, See a previous answer that I helped a guy out with here: <http://www.mathworks.com/matlabcentral/answers/29799-adding...

fast 10 Jahre ago | 0

Answered

GUIDE

You can't put a 5 character string into a single spot in a matrix. You'll need to use cell arrays to do what you're trying to do...

GUIDE

You can't put a 5 character string into a single spot in a matrix. You'll need to use cell arrays to do what you're trying to do...

fast 10 Jahre ago | 1

| accepted

Solved

All capital?

Are all the letters in the input string capital letters? Examples: 'MNOP' -> 1 'MN0P' -> 0

fast 10 Jahre ago

Solved

radius of a spherical planet

you just measured its surface area, that is the input.

fast 10 Jahre ago

Solved

Reverse the vector

Reverse the vector elements. Example: Input x = [1,2,3,4,5,6,7,8,9] Output y = [9,8,7,6,5,4,3,2,1]

fast 10 Jahre ago

Solved

Quote Doubler

Given a string s1, find all occurrences of the single quote character and replace them with two occurrences of the single quote ...

fast 10 Jahre ago

Solved

Which values occur exactly three times?

Return a list of all values (sorted smallest to largest) that appear exactly three times in the input vector x. So if x = [1 2...

fast 10 Jahre ago

Solved

Who Has the Most Change?

You have a matrix for which each row is a person and the columns represent the number of quarters, nickels, dimes, and pennies t...

fast 10 Jahre ago

Solved

Nearest Numbers

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

fast 10 Jahre ago

Solved

Target sorting

Sort the given list of numbers |a| according to how far away each element is from the target value |t|. The result should return...

fast 10 Jahre ago

Solved

Project Euler: Problem 10, Sum of Primes

The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below the input, N. Thank you <http:/...

fast 10 Jahre ago

Solved

Project Euler: Problem 2, Sum of even Fibonacci

Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 te...

fast 10 Jahre ago

Answered

plotting in a loop - new figure window

how about: clear all Data.S1 = struct('data1',rand(12,1),'data2',rand(12,1),'data3',rand(12,1)); Data.S2 = struct('d...

plotting in a loop - new figure window

how about: clear all Data.S1 = struct('data1',rand(12,1),'data2',rand(12,1),'data3',rand(12,1)); Data.S2 = struct('d...

fast 10 Jahre ago | 1

| accepted

Answered

request user input for a number of inputs

There are several ways to do this, but if you're wanting cell arrays, I'd do something like this: for i = 1:length(Location...

request user input for a number of inputs

There are several ways to do this, but if you're wanting cell arrays, I'd do something like this: for i = 1:length(Location...

fast 10 Jahre ago | 1

| accepted

Solved

Project Euler: Problem 1, Multiples of 3 and 5

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23...

fast 10 Jahre ago

Solved

Increment a number, given its digits

Take as input an array of digits (e.g. x = [1 2 3]) and output an array of digits that is that number "incremented" properly, (i...

fast 10 Jahre ago

Solved

Factorize THIS, buddy

List the prime factors for the input number, in decreasing order. List each factor only once, even if the factorization includes...

fast 10 Jahre ago

Solved

Too mean-spirited

Find the mean of each consecutive pair of numbers in the input row vector. For example, x=[1 2 3] ----> y = [1.5 2.5] x=[1...

fast 10 Jahre ago