Answered
write a program that creates two vectors from x—one (call it P) that contains the positive elements of x, and a second (call it N) that contains negative. I cant create the arrays
Then try growing P and N per iteration (don't use in real codes - it's slow due to matrix creation and copying). Currently, P an...

8 years ago | 0

Answered
Read text file lines and analyze
If you deal with a lot of fasta files, look into <https://www.mathworks.com/help/bioinfo/ref/fastaread.html fastaread> (Matlab B...

8 years ago | 0

Answered
How do you correlate 2 unique inputs to the 3 outputs given?
Use <https://www.mathworks.com/help/matlab/ref/fminsearch.html fminsearch> to determine [i1, i2] that satisfies [o1, o2, o3] wit...

8 years ago | 0

Answered
Call several handles with the same name
I think dynamic field names are what you want to use. <https://www.mathworks.com/help/matlab/matlab_prog/generate-field-name...

8 years ago | 0

Answered
How can I use symbols in my answer
ans = [45 47 60] sprintf('%0.4f° %0.4f'' %0.4f"', ans(:))

8 years ago | 0

| accepted

Answered
How do I exclude NaN values when calculating mean of each row in a matrix?
Remove the for loop, as it only does the last column, which can't be averaged. To take mean with NaN's in it, use José-Luis' ...

8 years ago | 0

Answered
Find the existence of a character from a struct
I think this works. Not the most efficient, but gets the job done. n=5; for i=1:n S(i).LOC='LL'; end Found...

8 years ago | 0

Answered
All parallel jobs become terminated if error occurs only in one of them
Try placing a try-catch statement around where the error occurs. Note that try-catch can slow down performance, but I guess it's...

8 years ago | 1

| accepted

Answered
How to compare two matrices of different dimension?
I'm guessing you want to find x values that are between two values, but for bounds dictated by a below_range and above_range mat...

8 years ago | 0

Answered
how to read svc file in matlab?
It looks like you're specifying a file path (pth_svc), but trying to open it as a file in fopen, which would give you an error. ...

8 years ago | 0

Answered
How do you plot sequentially numbered files on one plot?
Assuming your asc txt files stores the data in the following pattern: x y x y x y Save the following functions as...

8 years ago | 0

| accepted

Answered
How to find all the words contains certain letter from a text file?
Try the following code for opening a file and looking for a word with lower case d. FID = fopen('filename.txt', 'r'); %Op...

8 years ago | 0

Answered
Save figure with minimal white space
I had a similar issue and so had to create a series of codes to make this work. Essentially, you'll have to determine the locati...

8 years ago | 0

Answered
Can you use the concatenation ability of MATLAB to combine a 3x4 and a 3x5 matrix?
Yes you can, as long as the row or column dimensions matches. A = zeros(3, 4) % A 3x4 matrix B = ones(3, 5) % a 3x...

8 years ago | 0

| accepted

Answered
Run parfor loop inside a function
The warning is just stating that the *vector* variables (th and x) will be copied to every worker for every iteration of the for...

8 years ago | 0