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

plus de 14 ans il y a | 0

Réponse apportée
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...

plus de 14 ans il y a | 0

Réponse apportée
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...

plus de 14 ans il y a | 0

Réponse apportée
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...

plus de 14 ans il y a | 2

A résolu


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...

plus de 14 ans il y a

A résolu


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...

plus de 14 ans il y a

A résolu


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...

plus de 14 ans il y a

A résolu


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...

plus de 14 ans il y a

A résolu


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

plus de 14 ans il y a

A résolu


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

plus de 14 ans il y a

A résolu


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 ...

plus de 14 ans il y a

A résolu


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...

plus de 14 ans il y a

A résolu


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:...

plus de 14 ans il y a

A résolu


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 ...

plus de 14 ans il y a

Réponse apportée
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 ...

plus de 14 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 14 ans il y a | 0

Réponse apportée
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...

plus de 14 ans il y a | 1

Réponse apportée
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(:...

plus de 14 ans il y a | 0

Réponse apportée
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...

plus de 14 ans il y a | 1

A résolu


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

plus de 14 ans il y a

Réponse apportée
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...

plus de 14 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 14 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 14 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 14 ans il y a | 0

Réponse apportée
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...

plus de 14 ans il y a | 0

| A accepté

Réponse apportée
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 % . % . ...

plus de 14 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 14 ans il y a | 0

Réponse apportée
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. ...

plus de 14 ans il y a | 1

| A accepté

Réponse apportée
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: ...

plus de 14 ans il y a | 0

Réponse apportée
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...

plus de 14 ans il y a | 1

Charger plus