Beantwortet
Inserting Zeros in a Matrix
How about this: startRow = 6; NewDataCol = zeros(10,1); NewDataCol(startRow-1 + (1:numel(DataCol))) = DataCol;

fast 14 Jahre vor | 0

Beantwortet
Passing a vector object to Matlab trough Mex routine
You need to build the struct yourself. This example might help point you in the right direction: <http://www.mathworks.com/h...

fast 14 Jahre vor | 0

Beantwortet
Constant variable
Well, you want greater-or-equal. So replace the == with >= Also, if you want to clarify an answer to a question, please writ...

fast 14 Jahre vor | 0

Beantwortet
including subject_name in variable with a loop
This has already been solved for you, but I'll chip in. In this case, there doesn't appear to be a good reason to use dynamic...

fast 14 Jahre vor | 2

Gelöst


Determine whether a vector is monotonically increasing
Return true if the elements of the input vector increase monotonically (i.e. each element is larger than the previous). Return f...

fast 14 Jahre vor

Gelöst


Create times-tables
At one time or another, we all had to memorize boring times tables. 5 times 5 is 25. 5 times 6 is 30. 12 times 12 is way more th...

fast 14 Jahre vor

Gelöst


Remove the vowels
Remove all the vowels in the given phrase. Example: Input s1 = 'Jack and Jill went up the hill' Output s2 is 'Jck nd Jll wn...

fast 14 Jahre vor

Gelöst


Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...

fast 14 Jahre vor

Gelöst


Add two numbers
Given a and b, return the sum a+b in c.

fast 14 Jahre vor

Gelöst


Determine if input is odd
Given the input n, return true if n is odd or false if n is even.

fast 14 Jahre vor

Gelöst


Find the sum of all the numbers of the input vector
Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

fast 14 Jahre vor

Gelöst


Make the vector [1 2 3 4 5 6 7 8 9 10]
In MATLAB, you create a vector by enclosing the elements in square brackets like so: x = [1 2 3 4] Commas are optional, s...

fast 14 Jahre vor

Gelöst


Times 2 - START HERE
Try out this test problem first. Given the variable x as your input, multiply it by two and put the result in y. Examples:...

fast 14 Jahre vor

Gelöst


Make an awesome ramp for a tiny motorcycle stuntman
Okay, given a vector, say v=[1 3 6 9 11], turn it into a matrix 'ramp' like so: m=[1 3 6 9 11; 3 6 9 11 0; 6 9 ...

fast 14 Jahre vor

Beantwortet
for loop results in NaN after 453 loops
Because the result of the first sinh term becomes Inf: > p = 452; > sinh(p*pi/L*H/2) ans = 1.1169e+308 ...

fast 14 Jahre vor | 0

| akzeptiert

Beantwortet
HOW TO FIND THE LOCAL MAXIMA FOR EVERY ROW IN A MATRIX
A = [0 -1.2 -0.6; -0.9 -5 -6; 0 -1.8 -2.5]; threshold = -1; result = max( A - threshold, 0 ); Now, you seem to be onl...

fast 14 Jahre vor | 0

Beantwortet
find a value & store in new variable (again)
Okay, since your matrix actually contains cells the equality operator doesn't work. I'll split the code up for extra clarity, s...

fast 14 Jahre vor | 1

Beantwortet
Constant variable
You can combine this all into a long command line, but let's split it up for clarity: col2select = info(:,2) < 100 & info(:...

fast 14 Jahre vor | 0

Beantwortet
find a value & store in new variable (again)
Use logical indexing: new_variable = A(A(:,1)==2, 2); This indexes all those rows of A where column 1 is equal to 2, sel...

fast 14 Jahre vor | 1

Gelöst


Magic!
Check whether the input matrix is a normal magic square: <http://en.wikipedia.org/wiki/Magic_square> Output the logical va...

fast 14 Jahre vor

Beantwortet
Adding and saving a structure array in GUI
You need to call: Ply_prop = load('Ply_prop.mat'); Otherwise all the fields from your struct will be loaded in as variab...

fast 14 Jahre vor | 0

| akzeptiert

Beantwortet
How to switch from fminsearch to fmincon?
At the risk of sounding patronising, I guess the first question is whether your inputs really are doubles. That error message i...

fast 14 Jahre vor | 0

| akzeptiert

Beantwortet
data analysis
Use the _find_ function: indices = find(x == max(x)); There might be more than one maximum, so your output might be a ve...

fast 14 Jahre vor | 0

| akzeptiert

Beantwortet
Multithreading with mex functions
Hey Paul, glad to know that solved your problem. You're still doing it the hard way though! =) Don't search through a direct...

fast 14 Jahre vor | 0

Beantwortet
Importing data from .rsp file
Is this what you're looking for? <http://www.mathworks.com/matlabcentral/fileexchange/9357-load-rpc-files-of-type-binary-shor...

fast 14 Jahre vor | 0

| akzeptiert

Beantwortet
Getting a script to continue to ask for a user specified input value until a certain input is entered.
Here you go =) while 1 x = input('etc etc'); if x == 0 break; elseif x <= 300 % . % . ...

fast 14 Jahre vor | 0

| akzeptiert

Beantwortet
torque / force problem
Yep you have a couple of errors. First, you set your time variable t as an array of zeros. You do this above your loop, whic...

fast 14 Jahre vor | 0

Beantwortet
C++ Mex File Crashing Intermittently
Sounds to me like you're doing something dodgey inside the C++ code. Specifically, a buffer overrun or invalid pointer access. ...

fast 14 Jahre vor | 1

| akzeptiert

Beantwortet
Out of memory while executing large matrix sizes
Type the following into the command window memory The output from mine is as follows: Maximum possible array: ...

fast 14 Jahre vor | 0

Beantwortet
How would I go about plotting an equation?
You are incorrect in your assumption that you define 'y' in the same manner as 'x'. To 'plot the equation' you first have to re...

fast 14 Jahre vor | 1

Mehr laden