Resuelto


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

casi 14 años hace

Resuelto


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

casi 14 años hace

Resuelto


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

casi 14 años hace

Resuelto


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

casi 14 años hace

Resuelto


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

casi 14 años hace

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

casi 14 años hace | 0

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

casi 14 años hace | 0

| aceptada

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

casi 14 años hace | 0

| aceptada

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

casi 14 años hace | 0

Respondida
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];

casi 14 años hace | 0

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

casi 14 años hace | 0

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

casi 14 años hace | 0

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

casi 14 años hace | 1

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

casi 14 años hace | 0

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

casi 14 años hace | 0

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

casi 14 años hace | 0

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

casi 14 años hace | 0

| aceptada

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

casi 14 años hace | 1

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

casi 14 años hace | 1

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

casi 14 años hace | 1

| aceptada

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

casi 14 años hace | 0

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

casi 14 años hace | 0

| aceptada

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

casi 14 años hace | 1

| aceptada

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

casi 14 años hace | 1

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

casi 14 años hace | 0

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

casi 14 años hace | 0

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

casi 14 años hace | 0

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

casi 14 años hace | 0

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

casi 14 años hace | 0

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

casi 14 años hace | 0

| aceptada

Cargar más