I have 300 topographic maps from a neurodevelopment-framework experiment.
I would like to plot a topographic map from EEG data which each second would show a different topographic map from the above 300 mentioned, ie, I'd like to make a dynamic plot / dynamic visualisation that would work as it follows:
every second showing a topographic map belonging to a certain age, example:
s_{1}{5}: topographic map of subject 1 with 5 years old
s_{2}{5}: topographic map of subject 2 with 5 years old
...
s_{x}{z}: topographic map of subject x with z years o\d
s_{n}{m}: topographic map of subject n with m years old \
with m > z, hence starting from the youngest to the oldest
Is that possible? At the end it would be a merely sequence of topographic maps
Related
This question already has answers here:
How do you concatenate the rows of a matrix into a vector?
(2 answers)
Closed 6 years ago.
I have a data matrix (XW_region) that is size 3x4x81x97. Put differently, XW_region is indexed as (day,time,lat,lon), so there are 4 lat/lon grids (i.e. maps, populated by XW_region values) per day for 3 days, leading to 12 lat/lon grids total.
e.g. size(XW_region) = 3 4 81 97
What I want to do is take each XW_region value from each grid cell from each time from each day, and put them into one (long) column vector. From there I want to create a boxplot of the data. I know how to do the boxplot, just need to get the data all combined into one column vector.
Do I need to use the squeeze function to break out each map by day and time?
Thanks!
I'm sure this is a duplicate somewhere, but this is probably what you want:
XW_region(:)
see more about the column operator here.
As well as #bla's perfectly correct answer, sometimes it's useful to use reshape instead:
reshape(XW_region, [], 1);
(This pattern is helpful in cases where the thing you want to turn into a column is already an expression involving indexing).
I'm new to MATLAB and am stumped with an assignment for my research position. I need to create a For loop that compares two sets of data (day one and day 2) from 180 electrodes. However, we only have overlapping data from 175 electrodes (common_chans). I need to make a list of all possible electrode combinations from day 1 and day 2 of the common_chans electrodes, and have it display as an Y x 2 matrix for the all the combinations.
Any suggestions on how to do this? I feel like it's simple but I just don't have the background. Thanks!
Not sure I understood your question correctly, but if you need to make a list of all possible pairs:
nchoosek(1:175,2)
This displays a 15225 x 2 matrix.
This assumes that you don't care about the order (e.g. once you compared electrode 3 with electrode 6, this assumes you don't want to compare again electrode 6 with electrode 3). So this is different from Luis' link.
This question already has an answer here:
Summing up till a certain interval
(1 answer)
Closed 8 years ago.
I have a dataset (which is an hdf5 file) that contains a list of 250000 values, all quite small (sub 10). I want to cut this into 5000 pieces, so 50 each, and I want to individually sum the values in each of these 5000 pieces. I then want to create a histogram of these 5000 pieces, so I need to store them as well.
I am trying to do this using MATLAB, as my very limited programming skills have been developed using this, and it seems suitable for these purposes. Now, I haven't gotten very far, but what I have done so far is:
for n = 1:50:249951
% CR check before (before pumping?)
ROdata = h5read('hdf5file', '/data', [n], [n+49]);
sum(ROdata)
end
Of course, this does not yet store the values of the sum for each n. But more importantly, it does not work. For n = 1, all is fine, and I get the correct value. But already for n = 51, (so summing 51-100), I do not get the correct sum. What's going wrong here?
How should I store these (not working) sums?
Are you looking for something like this?
I assumed you already read your data and you have a 250000x1 vector.
%example data
data = randi(42,1,250000);
% rearranges your vector in groups of 50
A = reshape(data,[],5000);
% sums every column of your reshaped vector
sums = sum(A,1);
hist(sums,5000)
i'm trying to draw a Graph with a user-friendly timeline having every day/week (to be decided by time range) as a label at x-axis. However, the datasource values are given on another basis - there might be 10 entries one day and the eleventh comes in a month.
See the photoshop image:
With the latest Core Plot drop I cannot find a way to do it, need your help.
Regards,
user792677.
The scatter plot asks the datasource for x-y pairs of data. There is no requirement that either value follow some sort of sequence or regular pattern. Other plot types work similarly, although the names and number of data fields can vary.
In your example, return 4 from the -numberOfRecordsForPlot: method. Return the following values from the -numberForPlot:field:recordIndex: method. The table assumes your y-values are calculated by a function f(x), but they can of course come from any source. Use the field parameter to determine whether the plot is asking for the x- or y- value.
Index X-Value Y-Value
0 1 f(1)
1 3 f(3)
2 9 f(9)
3 10 f(10)
I have been working with MATLAB's treeplot function, but it seems to provide surprisingly little plotting functionality and/or extendibility.
I am plotting a tree like so:
tree = [0 1 2 2 2 2 2 1 8 8 1 11 11 1 14];
treeplot(tree)
Giving:
What I would like to do is add annotations or labels to specific nodes. A good starter would be to add the node numbers to each node, as in the example from the help file:
As they state, though:
These indices are shown only for the point of illustrating the example; they are not part of the treeplot output.
Is there a way to get the locations of the plotted nodes, or at the very least to plot the node numbers? I couldn't find any FEX submissions with more advanced tree plots.
Ultimately, I'd like to plot small pictures at the nodes (using methods from answers to a previous question of mine).
This should help you make a labeled tree:
(You supply the 'treeVec'.)
treeplot(treeVec);
count = size(treeVec,2);
[x,y] = treelayout(treeVec);
x = x';
y = y';
name1 = cellstr(num2str((1:count)'));
text(x(:,1), y(:,1), name1, 'VerticalAlignment','bottom','HorizontalAlignment','right')
title({'Level Lines'},'FontSize',12,'FontName','Times New Roman');
With your sample input, this gives
To get the position of the nodes, use treelayout
[x,y]=treelayout(tree);
The vectors x and y give you the positions, which you can then use to plot images at the nodes.