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

14年弱 前 | 0

回答済み
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...

14年弱 前 | 0

回答済み
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...

14年弱 前 | 0

回答済み
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...

14年弱 前 | 2

解決済み


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

14年弱 前

解決済み


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

14年弱 前

解決済み


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

14年弱 前

解決済み


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

14年弱 前

解決済み


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

14年弱 前

解決済み


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

14年弱 前

解決済み


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

14年弱 前

解決済み


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

14年弱 前

解決済み


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

14年弱 前

解決済み


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

14年弱 前

回答済み
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 ...

14年弱 前 | 0

| 採用済み

回答済み
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...

14年弱 前 | 0

回答済み
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...

14年弱 前 | 1

回答済み
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(:...

14年弱 前 | 0

回答済み
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...

14年弱 前 | 1

解決済み


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

14年弱 前

回答済み
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...

14年弱 前 | 0

| 採用済み

回答済み
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...

14年弱 前 | 0

| 採用済み

回答済み
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...

14年弱 前 | 0

| 採用済み

回答済み
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...

14年弱 前 | 0

回答済み
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...

14年弱 前 | 0

| 採用済み

回答済み
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 % . % . ...

14年弱 前 | 0

| 採用済み

回答済み
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...

14年弱 前 | 0

回答済み
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. ...

14年弱 前 | 1

| 採用済み

回答済み
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: ...

14年弱 前 | 0

回答済み
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...

14年弱 前 | 1

さらに読み込む