Respondida
Find the median of sequential duplicate entries
One way to achieve this is to replace |num(:,2)| with a monotonically increasing group/block ID that you build. Here is how: ...

casi 12 años hace | 2

| aceptada

Respondida
How to find the indices of element occuring once in a vector?
There are ways to solve your problem based on HISTC or ACCUMARRAY. However, the simplest approach if you really have only two si...

casi 12 años hace | 2

| aceptada

Respondida
How do I use suptitle in my subplot
I usually build the array of subplots by myself in these cases, because I find that SUBPLOT is a bit too rigid. This essentially...

casi 12 años hace | 12

| aceptada

Respondida
Check if a number of varibles in a function satifies a condition.
There are already tools for performing these tasks. Check out the |InputParser| class [ <http://www.mathworks.com/help/matlab/ma...

casi 12 años hace | 1

| aceptada

Respondida
Create function for info extraction from .log file
You should be able to extract these 3 columns as follows: content = fileread( 'myFile.txt' ) ; data = textscan( content, '...

casi 12 años hace | 2

| aceptada

Respondida
How can I extract data from a large ASCII file?
>> doc textscan and use the parameter |HeaderLines| to skip the header. Supposing that you have 7 header lines and that you ...

casi 12 años hace | 1

| aceptada

Respondida
How can I design these nested for loops so they run much faster?
B_new = B(ismember(B(:,2), A(:,2)),:) ; should take a fraction of second with the sizes that you mention.

casi 12 años hace | 1

Respondida
keeping elements of certain indices of an array
The simplest way is probably as follows: indices = [11:2:41, 45:4:101, 111:10:401, 441:40:801, 901, 1001] ; D = B(indices)...

casi 12 años hace | 4

| aceptada

Respondida
Question about 3D point intersection
As suggested by Image Analyst, I am moving my comment here. A good method for rotating points in the 3D space is to use quaterni...

casi 12 años hace | 2

| aceptada

Respondida
Collate Data in Grid
In addition to Image Analyst's hints, you could also look at * <http://www.mathworks.com/help/stats/hist3.html hist3> if you ...

casi 12 años hace | 2

| aceptada

Respondida
Please can someone help me?!
You could also ask her to repeat really slowwwwwwly the letter 'M' ( - - ), sync' her with the day/night pattern, and you would ...

casi 12 años hace | 1

Respondida
Filtering max values within every 3 hours of data
You could build an approach along the following line: % - Build array of time components. dv = datevec( datatoupload(:,1)...

casi 12 años hace | 2

| aceptada

Respondida
Creating a hard link among properties of an object?
*NOTE:* well, I spent an hour stuck in a mall with a tornado warning, so I had a little time to extend my first example. See *ED...

casi 12 años hace | 2

Respondida
Repeat last row at the end of matrix?
B = [A; A(end,:)] ;

casi 12 años hace | 2

| aceptada

Respondida
Multiplication of elements in array
And if you aren't too familiar with Andrei's singleton expansion in 3D numeric arrays ;-), here is a simpler and less compact so...

casi 12 años hace | 2

| aceptada

Respondida
Change function myfind (index)
Using the same approach as you developed so far, you would have to build |index| as a vector: index = [] ; for k = 1 : len...

casi 12 años hace | 1

| aceptada

Respondida
Counting subrows in each row of a matrix?
Assuming that |n| is defined previously as >> n = 5 ; (for the case of your example) here is a one liner >> B = sum( ...

casi 12 años hace | 1

| aceptada

Respondida
updating/inserting summary array
You would have to test, but here is what I guess is an efficient solution: colors = {'red', 'black', 'red', 'green', 'red...

casi 12 años hace | 1

Respondida
Saving very large data. How do preallocate and stream to disk?
I would avoid using sparse matrices unless you really need matrices for computing, and store indices and values in numeric array...

casi 12 años hace | 2

Respondida
Check for 1 in a array
Here is an example: A = randi( 10, 3 ,20 ) % Dummy example. if any( A(2,:) == 1 ) fprintf( 'Found at least one 1 on ...

casi 12 años hace | 3

| aceptada

Respondida
Counting the number of events and total number of blocks from a file.
Hello Aneps, when I run the following code on your text document: content = fileread( 'Test.txt' ) ; blocks = regexp( con...

casi 12 años hace | 2

| aceptada

Respondida
Replacing row number with value
A simple way is: c = a(b,:) ;

casi 12 años hace | 2

Respondida
How can I make an inset plot with log axes?
You could build the insert by yourself. Here is an example: % - Define dummy data. t = 0 : 0.1 : 10 ; yModel = sin( t ) ...

casi 12 años hace | 1

| aceptada

Respondida
How can I read from a text file in the following format?
If block sizes can vary, I would build a solution around: content = fileread( 'myFile.txt' ) ; nCols = 4 ; blocks =...

casi 12 años hace | 1

Respondida
I AM USING FOR LOOP AND WANT RESULTS IN ARRAY FORMAT WITHOUT DISPLAYING VARIABLE NAME
Example: x = rand( 5, 1 ) ; for k = 1 : length( x ) fprintf( '%.2f, ', x(k) ) ; end fprintf( '\n' ) ; If you n...

casi 12 años hace | 2

| aceptada

Respondida
changing values in a certain column of a matrix
First, you build a logical index of all values equal to 990 in column 5: lId = A(:,5) == 990 ; Then you use it to index r...

casi 12 años hace | 13

| aceptada

Respondida
Identical random on two arrays
Use <http://www.mathworks.com/help/matlab/ref/randperm.html RANDPERM> to generate an index vector, that you use then to index bo...

casi 12 años hace | 5

| aceptada

Respondida
Import Text File Data With Blank Rows
Run the following content = fileread( 's1.txt' ) ; blocks = regexp( content, '-[\n\r]+([^X]*)', 'tokens' ) ; blocks = ...

casi 12 años hace | 2

| aceptada

Respondida
strcat(strings) to call a variable or matrix
You want to store your zone data in a numeric array or a cell array, and then index it for passing the relevant data item to the...

casi 12 años hace | 3

| aceptada

Respondida
How to append data for a variable column in a matrix?
Assuming D = {'AEA', 'AEA00'; 'AW', 'WP000'} you can concatenate e.g. row 1 with >> sprintf( '%s-', D{1,:} ) ans = ...

casi 12 años hace | 2

| aceptada

Cargar más