Solved


Replace NaNs with the number that appears to its left in the row.
Replace NaNs with the number that appears to its left in the row. If there are more than one consecutive NaNs, they should all ...

14 years ago

Solved


Counting Money
Add the numbers given in the cell array of strings. The strings represent amounts of money using this notation: $99,999.99. E...

14 years ago

Solved


Pangrams!
A pangram, or holoalphabetic sentence, is a sentence using every letter of the alphabet at least once. Example: Input s ...

14 years ago

Solved


Triangle Numbers
Triangle numbers are the sums of successive integers. So 6 is a triangle number because 6 = 1 + 2 + 3 which can be displa...

14 years ago

Solved


Column Removal
Remove the nth column from input matrix A and return the resulting matrix in output B. So if A = [1 2 3; 4 5 6]; and ...

14 years ago

Answered
hi
I think you mean this: x = -3:3; y = 2 * x + 3; plot(x, y);

14 years ago | 0

Answered
Create test questions with multi choices
How about this: % Asks for a,b,c-style choices and returns the corresponding choice as a % number from 1 to numel(choice...

14 years ago | 0

| accepted

Answered
How to change TolFun?
You haven't said which solver you are using. Let's assume *fzero*: opts = optimset('fzero'); opts = optimset( opts, 'To...

14 years ago | 0

| accepted

Answered
saving vectors to an excel file
To build the filename use: ['C:\Folder\' files{k}]

14 years ago | 0

Answered
How to play Maximum length sequence twice?
If you just want to repeat your signal you can append a copy like this (assuming single-row vector): x = [x x];

14 years ago | 0

Answered
Recursion
Well, the thing with recursion is you take a larger problem and make it slightly smaller. So, to begin with you test whether yo...

14 years ago | 0

Answered
Saving matlab code / good programming practice
You might want your function to store the run date/time when invoked, and store both itself and its output. That way, any chang...

14 years ago | 0

Answered
Reading Text files and Writing to Excel sheets
You're making it pretty hard on yourself, using the file I/O functions. Try using the *textread* function to slurp everything...

14 years ago | 1

Answered
XLSWRITE
If you prefer a GUI interface, do this: [filename, pathname] = uiputfile( ... {'*.xls','Excel spreadsheet (*.xls)'; '*...

14 years ago | 0

Answered
basic code question
To get all but the last 3, use this: x1(1:end-3) You can work out how to get all but the first 3 =) And you already k...

14 years ago | 0

Answered
How to add a favorite vector as labels for plot() function?
set(gca,'XTick',[1 2.2 3.14]);

14 years ago | 0

Answered
basic code question
I assume A and B are both 100x1 row-vectors: C = [A B];

14 years ago | 0

| accepted

Answered
Find value in second column when first column is x
The *find* function will give you the row numbers. Type: help find But if you don't care about the row indices, the pre...

14 years ago | 1

Answered
How to generate pseudo random number with fix range ?
I've seen this kind of question asked before. Have a look at the solution here: <http://www.mathworks.com.au/matlabcentral/a...

14 years ago | 1

Answered
Plotting large amounts of txt files then exporting results
You want to start with the *dir* command to find the contents of a directory. indir = 'mydatadir\'; % or / if you are not ...

14 years ago | 1

| accepted

Answered
A-star obstacles
The problem is you can only compare matrices with the same dimensions, or a matrix with a scalar. You want to compare a matrix ...

14 years ago | 0

Answered
2D PEAK FINDER
Howdy, if you only want to plot the peaks (with their original values) B = A; B(B <= threshold) = NaN; plot(B'); % T...

14 years ago | 0

| accepted

Answered
append rows to same .mat file (without replacing)
From the documentation on save: '-append': Add data to an existing file. Does your file exist? if col == 1 ...

14 years ago | 1

| accepted

Answered
A simple question about solving the polynomial
Well, there's two things here. Did you even want a polynomial in terms of x? If not, why not initially solve in terms of y? ...

14 years ago | 1

Answered
Transposing matrix using reshape
Okay, got a solution. Your matrix (let's just use the example of A) can be indexed by the vector 1:6, but you need to translate...

14 years ago | 0

Answered
save to excel file
You are telling it to start in the same cell every time through the loop.

14 years ago | 0

Answered
second color of bar() always black?
Organise your data series into columns in a matrix and do a single bar plot. Assuming a1 and b1 are the same length, do this:...

14 years ago | 0

Answered
Reading every 10th Trial Error
Your script has multiple errors, and some things that simply don't make sense. For example, why do you use _i_ to count to 10, ...

14 years ago | 0

Answered
Sort
You haven't really specified if you want a sequence or just a set of numbers. Picking up on your term 'generate', perhaps you m...

14 years ago | 0

Answered
How to use system to copy binary files which are not in the current directory
Have you tried just doing this from the Windows command prompt? I wasn't aware that the copy command would happily append fil...

14 years ago | 0

| accepted

Load more