Solved


Alphabetize by last name
Given a list of names in a cell array, sort the list by the last name. So if list = {'Barney Google','Snuffy Smith','Dagwood ...

6 years ago

Answered
How can I plot a figure with 5 subplots and save it and then move to the next figure containing 5 subplots and save it under an other name?
You can assign a figure number with the figure command. You can save a figure with the savefig command. Just put them both, or...

6 years ago | 0

| accepted

Solved


Read a column of numbers and interpolate missing data
Given an input cell array of strings s, pick out the second column and turn it into a row vector of data. Missing data will be i...

6 years ago

Solved


Interpolator
You have a two vectors, a and b. They are monotonic and the same length. Given a value, va, where va is between a(1) and a(end...

6 years ago

Answered
Creating a structure array containing names of external files
As Rik mentioned, it sounds like dir is what you want. files = dir(path); This will return a structure called 'files' which co...

7 years ago | 0

| accepted

Answered
How to store lines in a text file based on preceding text
There are a couple of methods for doing this. Let me know if you have questions. fid = fopen('mytextfile.txt'); line = fgetl(f...

7 years ago | 0

Answered
Find string in txt and delete searched string line
You can use Jan's method from the linked question to find your lines. Then once you have found them turn them into blank lines (...

7 years ago | 0

| accepted

Answered
Nested for loop, too slow
It looks like you want to blank the entire row, correct? A = 1:56:2464; D(A,:) = 0; EDIT** Change variable names as you need ...

7 years ago | 0

| accepted

Answered
Importing Excel multiple sheet with individual multiple columns
What exactly is your question? What specifically do you need help with? xlsread is only able to read one sheet at a time, so wh...

7 years ago | 0

| accepted

Answered
applying algebraic eqns across multiple dimesions of matrix using indexing
Ok, you aren't too far off with your thoughts, but I'll include an example. You should be able to cover the first and second di...

7 years ago | 1

| accepted

Answered
Importing a Large CSV in chunks and getting Data Range Invalid
You can call headerlines to specify a starting point with textscan, but I don't know if it is possible to specify an ending poin...

7 years ago | 0

Answered
How to extract the following number from a text file?
There are a couple of options how to do this. You can read the entire file in as strings, find the line you want, and regexp the...

7 years ago | 1

| accepted

Answered
How to resolve a too many input argument error from using Function
Thank you for posting the other functions. When I attempted to run your code I encountered an error due to the naming convention...

7 years ago | 0

| accepted

Answered
change color in loop with scatter3?
Changing the color with the position is done with an if statement, just like you suggested. for i = 1:size(Nbrc,1) ... % D...

7 years ago | 0

| accepted

Answered
How to save lots of 3D matrix obtained from a for loop in matlab
'Could you please tell me how to achieve this?' It seems like you have done this already. Is there something not working in the...

7 years ago | 0

| accepted

Answered
How can i make the Temp matrix to contain all the values of T calculated in both conditions
H = [ 1:10:100] L = 0.0065 %K/m T0= 288.15 Temp= zeros(j) for j= 1:length(H) for B = H<=11 % till 11 km ...

7 years ago | 1

| accepted

Answered
Running a matlab file multiple times on the same computer
Short answer is yes, it is possible, but unfortunately I am not exactly sure how to do it. If I remember the method I saw it was...

7 years ago | 0

Answered
How to add a new column in a txt file with if condition
What kind of data do you have in the file? The type of data really determines the complexity of this answer. The basic steps of ...

7 years ago | 0

| accepted

Answered
Opening mat files with uiopen and copying data to array
It seems like your issue isn't so much opening specific files, but identifying new variables. With a bit of trickery you can ide...

7 years ago | 0

Answered
Help finding the first minimum value in an array and indexing the value in a new array!!!
Part of the issue you're having is that your if statement doesn't have an actual condition in it. if (find((v(i)<v(i+1)) && (v(...

7 years ago | 0

| accepted

Answered
Indexing inside a for loop when satisfying a condition
I usually get around this by having a second index which is advanced only with the condition. c = 1; % Index of 'Index' for j=...

7 years ago | 1

| accepted

Answered
How do it store a particularText file into an array ?
I would suggest loading the file and then splitting. string = readfile('TestLists.txt'); lines = regexp(string,'\n','split');

7 years ago | 0

Answered
Extract matrix from matrix
In general you should be able to do this with logic indexing fairly easily. I'm a little confused though how or why you have a 2...

7 years ago | 0

Answered
Loop question (general programming)
I would suggest creating an array of the possible conditions you want. A = {'param'; 'm_param'; 'g_param'}; Then you can just ...

7 years ago | 1

| accepted

Answered
How to find average of all maltab files in folder and write avrage of each file in single excel file.
You are receiving that error because you are trying to load the directory string, not the file. M = load(matFiles(k).name);

7 years ago | 1

| accepted

Answered
read empty line by textscan
I'm going to guess that the extra lines are not consistent? Generally, I would suggest reading the entire file in as one string...

7 years ago | 0

Answered
help with if conditional statement
I don't really understand all of what you're looking to do, but perhaps I can give some basic outline of how you can set up the ...

7 years ago | 0

Answered
Extract rows an put them in a different array based on specific column values.
I'm a little confused what exactly you're looking for here, but hopefully I can at least get you started. To retain all rows wh...

7 years ago | 0

Answered
How to create code to remove rows from a table
You're on the right track by using logic to identify whether a row contains a 0, but you would be better off marking different r...

7 years ago | 1

| accepted

Load more