Answered
How to load numeric & string data from .txt file
This should do it, for your specific case: fid = fopen('data.txt', 'rt'); C = textscan(fid, '%d %s %f,%f,%f', 'HeaderLin...

13 years ago | 3

| accepted

Answered
How can I limit the maxmimum number of files to be loaded from a database?
You could use dir() to get the names of all *.mat files, and then use randperm() to randomly choose 15000 of them. Something lik...

13 years ago | 0

| accepted

Answered
Ignore elements in an array.
Are Value and Time the same size? If so, you can just do this, using logical indexing (no loops): deleteThese = (Value <= 0...

13 years ago | 0

| accepted

Answered
Need Conditional ElseIf statement
Matlab won't correctly parse the 0<w(5)<255 statement as you intend. (Instead, it will evaluate (0 < w(5)) first (which returns ...

13 years ago | 1

Answered
Is it possible to plot a function T(x,y,z,t), or even just T(x,y,z)?
Sure, the easiest way is to represent the T value using color, using scatter3 (for discrete data), or patch/surf (for continuous...

13 years ago | 0

| accepted

Answered
unexact calculations when using delayss
Hi David, This is due to the fact that Matlab (like any computational program) stores numbers in a finite-precision length. I...

13 years ago | 0

Answered
How to Import unformatted text data?
Hi Maddila, This looks like a rather non-uniform format, so your best bet might be to read in the full file, and then separat...

13 years ago | 0

| accepted

Answered
how to connect coordinate points?
Hi Sayak, I'm a little bit unclear on what you are trying to do, but I think you want to use bwboundaries. That will give you...

13 years ago | 0

| accepted

Answered
Is there any other alternative fuction that I can use instead of fminunc?.
Hi Salva, You could use fminsearch or fminbnd, two derivative-free optimizers. However, given that the error is thrown when t...

13 years ago | 0

Answered
converting matlab image to jpg image
doc imwrite

13 years ago | 0

Answered
I want to read ascii file into matlab which has 191 rows and 9 columns. Then I have to convert it into matrix form that too row wise also I have to convert magnitude and angle into real and imaginary parts.
To read the ASCII file into Matlab: doc textscan To convert from magnitude-angle to complex a+bj, just use Complex=...

13 years ago | 0

| accepted

Answered
Setting X as a column of a matrix
You can also do this using logical indexing, which is a more "Matlab-y" way to do this problem... y = repmat('A', size(M(...

13 years ago | 0

Answered
how to get the background of an image?
This question is almost impossible to answer without a) the image in question, and b) your definition of what the "background" i...

13 years ago | 0

| accepted

Answered
How can I withdraw a colon operator from a string
Mr. Azzi's technique is more general, and I would use it for your purpose. However, if you did want to use 'find' to locate s...

13 years ago | 0

Answered
normalize a maatrix of 13 columns
Hi Kim, Let's go through each step: To square, use A^.2 To sum, use the sum() function. Read the documentation to learn...

13 years ago | 0

Answered
Text file reading problem
Hi Oscar, I've had a similar issue (reading data from a text file with an irregular format, and instead a series of "keys" th...

13 years ago | 0

| accepted

Answered
Delete the Whole Row and Merge The Next Row in a matrix
I'm not sure I understand what "merge" you are trying to do. It sounds like you just want to delete rows that satisfy a particul...

13 years ago | 1

| accepted

Answered
open a folder outside of MATLAB
I am assuming by your directory structure you have Windows: winopen('G:\name1\inputs');

13 years ago | 7

| accepted

Answered
about figure is control
Hi Pan, It is not really clear in your question what behavior you want. Are you saying that you have two figures, Figure1 and...

13 years ago | 0

Answered
Improving modal analysis code
Hi Pinco, What are the dimensions of BI2, PHI, and y? You might be able to use matrix multiplication directly to eliminate t...

13 years ago | 0

| accepted

Answered
how to inverse a vector
doc sort

13 years ago | 0

Answered
plot 1st order bessel derivative
I think you need to use element-wise division with the z: a=besselj(0, z) - besselj(1, z)./z;

13 years ago | 1

| accepted

Answered
What is the approach to simultaneously changing the brightness on both the GUI axes and figure?
What do you mean by "brighten" the figure? Do you mean that you want the background color to become a lighter shade of gray (or ...

13 years ago | 0

Answered
Standard deviation ignoring 0s in matrix
One easy way would be to convert all zeros to NaN, and then use the nanstd function to ignore the NaNs in the std calculation. ...

13 years ago | 1

| accepted

Answered
How to extract data from a figure which contains a uitable?
The number that is given when you do get(gcf,'Children') is the handle to one of the child objects (presumably the uitable if th...

13 years ago | 0

| accepted

Answered
Mapping colored image on grayscale
What do you want the resulting image to look like? Do you want the brain to render as gray, with the tumor shown in the flame-li...

13 years ago | 0

Answered
rows which do not contain zero
row = any(D,2); rowCount = sum(row); %number of rows with non-zero elements

13 years ago | 0

| accepted

Answered
Brain tumor detection in CT data
Hi Peter, Nobody is going to be able to give you a full turnkey solution to your problem, largely because a) such a task is p...

13 years ago | 0

| accepted

Answered
I have a code for Powell's hybrid method for optimization can any one change it to Matlab
Hi Raj, This code appears to be written in Fortran. In general, nobody on this forum is going to have the time to convert you...

13 years ago | 1

Answered
How can i store the labeled coordinates in differnt arrays?
Run regionprops() on B, and then look at the 'PixelList' property.

13 years ago | 0

Load more