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

casi 14 años hace | 0

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

casi 14 años hace | 0

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

casi 14 años hace | 0

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

casi 14 años hace | 2

Resuelto


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

casi 14 años hace

Resuelto


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

casi 14 años hace

Resuelto


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

casi 14 años hace

Resuelto


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

casi 14 años hace

Resuelto


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

casi 14 años hace

Resuelto


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

casi 14 años hace

Resuelto


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

casi 14 años hace

Resuelto


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

casi 14 años hace

Resuelto


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

casi 14 años hace

Resuelto


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

casi 14 años hace

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

casi 14 años hace | 0

| aceptada

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

casi 14 años hace | 0

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

casi 14 años hace | 1

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

casi 14 años hace | 0

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

casi 14 años hace | 1

Resuelto


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

casi 14 años hace

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

casi 14 años hace | 0

| aceptada

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

casi 14 años hace | 0

| aceptada

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

casi 14 años hace | 0

| aceptada

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

casi 14 años hace | 0

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

casi 14 años hace | 0

| aceptada

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

casi 14 años hace | 0

| aceptada

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

casi 14 años hace | 0

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

casi 14 años hace | 1

| aceptada

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

casi 14 años hace | 0

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

casi 14 años hace | 1

Cargar más