Answered
How to reduce number of loops
Ok, well, you could adapt the following to your case then. I am not checking in-depth that it is working though, and there is ro...

13 years ago | 1

| accepted

Answered
Is it possible to section a very long string into a matrix?
One way would be: >> s = '56748946489148461898434919946189189454961894564349894389' ; >> num = sscanf(s, '%4f') num = ...

13 years ago | 2

Answered
merging two matrices (cell matrices)
The following would be one way if I interpret well your question (which is not completely clear): C = reshape([A;B], size(A,...

13 years ago | 0

| accepted

Answered
How can i connect my matlab program with matlab GUI?
I would recommend the official documentation: <http://www.mathworks.com/help/pdf_doc/allpdf.html> Under MATLAB, you can ge...

13 years ago | 0

Answered
Extracting data from txt file
It is a good attempt that you made here with FOPEN and FSCANF; we can discuss the format if you want, but I would recommend usin...

13 years ago | 1

| accepted

Answered
How can i sum every 12th block of data from a large data set?
You can go for a solution around: n = size(unit1, 1) ; % Should be 124390, id = zeros(n, 1) ; ...

13 years ago | 0

| accepted

Answered
Will I even use Matlab in my engineering career?
I would say that there is almost 100% chance that having learnt a language/framework for scientific computing will be useful to...

13 years ago | 5

Answered
How to read formated data with implied decimal point
Not to my knowledge, but even the conversion in multiple steps is interesting (and it will prop up your question as a small cha...

13 years ago | 0

Answered
How can I load a large csv file?
Did you try using CSVREAD and DLMREAD? The latter would allow you loading the file by block. Also, what type of data is store...

13 years ago | 0

Answered
Construct a large sparse matrix
Nowadays most functions are able to work on sparse matrices and output sparse matrices. If you want to be sure that it is workin...

13 years ago | 0

| accepted

Answered
in a nested for loop, if statement: how to keep doing something until a condition is met
I am not sure that I really get what you want to do, but I guess that it is something around the following (which is dangerous, ...

13 years ago | 2

| accepted

Answered
Fracture fatigue problem, summation inside loops
You are setting a condition on |dK| in your WHILE statement, but you compute |dK1| in the loop. Both should match (either use |d...

13 years ago | 0

| accepted

Answered
I am wondering how to pull up information in an excel file if the user just inputs keywords into the matlab program? so that when hey enter the key word matlab finds it in the excel file. thanks.
Accessing Excel files is rather slow; you should read the full Excel file first using XLSREAD, and then work only at MATLAB leve...

13 years ago | 0

Answered
How to get arg min of an N-dimensional Matrix ?
How do you define |argmin|? If it is the global min, you can get it as follows: min(M(:)) where |M| is your 3D array.

13 years ago | 1

Answered
printmat function for unknown number of rows
You can build your headers using SPRINTF; for example: >> M = rand(6) ; >> vheader = sprintf('ROW%d ', 1:size(M,1)) vhea...

13 years ago | 0

| accepted

Answered
To replace a character AT A PARTICULAR POSITION in a Text FIle.
*I see that you accepted 0% of the answers that were given to your 4 previous questions; please take a moment for reviewing thes...

13 years ago | 0

| accepted

Answered
Need help extracting the input from a dialog box and then fprintf it in the command window.
Almost correct; just bring the following change: fprintf( '%s = Player1\n', DialogBox{1} ) ; fprintf( '%s = Player2\n', D...

13 years ago | 0

Answered
Best practice for saving only one output from a vector-outputting function
Simply WantThis = myfun(x, y, ... ) if you just need/want the first output. More generally [a, b, c, d] = myfun(x, y,...

13 years ago | 0

| accepted

Answered
How to remove lines in a .txt file?
If you read the file using TEXTREAD, you don't need to have the file truncated first, because you can tell TEXTREAD to skip a gi...

13 years ago | 7

| accepted

Answered
Earth Grided Data of equivalent water height
If you have ArcGIS, you can import your dataset as an X-Y layer and save it as a point feature class using a geographical WGS198...

13 years ago | 1

Answered
How to create a vector with for loops and if statements
What about: v = zeros(size(t)) ; id = t >= 0 & t <= 1 ; v(id) = 1000 * t(id) ; or simpler and more efficient from the...

13 years ago | 2

| accepted

Answered
I need some help with logical operators and the find function...
You compute all elements of |V| and |H|, so they are fully defined at the moment you want to select relevant times. You can use ...

13 years ago | 0

| accepted

Answered
adding matrix to every column in other matrix
b_ext = repmat(b, 1, size(a, 2)) ; c = a + b_ext ;

13 years ago | 0

| accepted

Answered
Replace part of a column in a matrix with different values
This is a valid approach only when |LLY| is a multiple of 4. I am unsure what it is that you want to achieve, but if you want to...

13 years ago | 0

| accepted

Answered
How to structure array to serve as input parameter for function and then display in sprintf?
SPRINTF and FPRINTF are repeating |formatSpec| as many times as needed to display the content of the arguments that follow. To i...

13 years ago | 1

| accepted

Answered
Can't get function to accept array params or return arrays
You want to use an element-by-element operator for the division: m = (y1 - y2)./(x1 - x2);

13 years ago | 1

| accepted

Answered
Show column which starts with certain numbers
If your matrix is named |M|, you can do col = M(1,:) == 1 & M(2,:) == 2 ; to get a vector of logicals indicating the rele...

13 years ago | 0

| accepted

Answered
hello professionals ..i have aattached my code plz suggest me why it is not displaying value of kp2 and e
Where do you define |M| ? At this point it crashes because |M| is undefined. A few additional points: * You should not nam...

13 years ago | 0

| accepted

Answered
Randomly delete elements of a matrix
Look at the following and let me know if you have any question: M = randi(10, 4, 5) ; % Random example. [nr,nc] = si...

13 years ago | 1

Answered
Average Windowing of Signal - noticeable delay as time increases
It seems to me that you are not really computing an average on windows around each value, but an average by block. If this |True...

13 years ago | 0

Load more