Community Profile

photo

Tommy


Last seen: Today
287 total contributions since 2017

Tommy's Badges

  • Pro
  • Knowledgeable Level 4
  • First Answer
  • Commenter
  • Solver

View details...

Contributions in
View by

Answered
How to eliminate colormap?
When you supply a 2D array to image(), the values within that array are mapped to a colormap. The colormap is needed to convert ...

environ 9 heures ago | 1

| accepted

Answered
How to make a log operation for a matrix excluding the '-inf' values?
k should span from 1 to size(IDHMA,2), similar to ii: for ii = 1: size (IDHMA,1) for kk = 1 : size (IDHMA,2) IDHMAlog (ii,...

1 jour ago | 0

Answered
How to make specific elements of a matrix zero before nth element?
Boring: C = A; for i = 1:size(A,2) C(1:B(i)-1,i) = 0; end Ugly: C = A; [N,M] = size(C); C(~any((1:N*M)'>=N*(0:M-1)+B...

2 jours ago | 1

Answered
Create new variable with only values of a certain variable
Try this: idx = mutualInfoTotal >= 5; % indices of values at least equal to 5 mutualInfoTotal = mutualInfoTotal(idx);

2 jours ago | 0

| accepted

Answered
How to get the data as output along with the histogram plot?
You could request output from histogram(): h = histogram(S,'Normalization','probability'); and access properties such as h.Bin...

2 jours ago | 2

| accepted

Answered
Finding pair values in a matrix
How about this? z = unique(sort(z,2),'rows');

3 jours ago | 0

Answered
Concatenating 2 vectors into 1 vector with the values adjacent to each other
Should February 2012 map to 20122 rather than 20121? If so, maybe this will do the trick? month = repmat((1:12)', 5, 1); year ...

4 jours ago | 0

Answered
Define a plot object but do not show the plot
plot_temperature=plot(day, temperature, 'Visible', 'off'); plot_rainfall=plot(day, rainfall, 'Visible', 'off'); Or if you don'...

5 jours ago | 0

| accepted

Answered
Change colour in stem plot, for only particuar values
You could overlay two separate stem plots: data = randi(10,10,1); idx = [4, 9]; ax = axes; hold(ax, 'on'); temp = data;...

5 jours ago | 0

| accepted

Answered
How to draw 2 different plot on a graph
hold on or set(gca, 'NextPlot', 'add') in between your calls to plot or however you are plotting.

6 jours ago | 0

Answered
MATLAB GUI: How do I pass image matrix into function
In appdesigner, first make sure you are in code view: Then in the code browser on the left side, go to the tab labeled Proper...

6 jours ago | 0

| accepted

Answered
How do I change axes font (heatmap)?
Your code is crashing at this line: h.xlabel('FontName', 'Times New Roman'); The x label is set properly because of the previo...

6 jours ago | 1

| accepted

Answered
how to debugg the error : size input must be integers
nx = 1.5; % Number of grid points x-direction ny = 0.5; % Number of grid points in the y direction "size input must be integ...

6 jours ago | 0

| accepted

Answered
How to use str2func with a function handle in the string
From the documentation for str2func, "Workspace variables are not available to the str2func function." See this answer. You ...

6 jours ago | 0

| accepted

Answered
Finding rows/indices by comparing individual elements of rows of one matrix to another
For less than or equal to: find(all(m1 <= m2, 2)) For less than: find(all(m1 < m2, 2))

6 jours ago | 2

| accepted

Answered
How to skip lines to execute/run?
return % ? Or have your if block encompass the lines to be skipped and change the condition to the opposite of your condition f...

6 jours ago | 0

Answered
How to design GUI buttons?
You can set the CData of a uicontrol pushbutton: p = uicontrol('Style', 'pushbutton', 'Position', [100, 150, 100, 30], 'String'...

6 jours ago | 1

| accepted

Answered
How to bold dialog box?
You can tell msgbox, inputdlg, warndlg, errordlg, and questdlg (and maybe others?) to use a tex interpreter. They all default to...

6 jours ago | 1

| accepted

Answered
How can I extract points (sum of values) from variable size groups of lines (separated from NaN values) in the same column ?
Potentially over-complicated but should work: cA = cumsum([A, B],'omitnan'); idx = [isnan(A(2:end)); 1] & ~isnan(A); C = diff...

7 jours ago | 1

Answered
How to split the data inside the matrix correctly?
Here's another uglier way. C = mat2cell(matrix, diff([0; find(diff(matrix(:,2))); size(matrix,1)]), 2);

7 jours ago | 0

| accepted

Answered
Using sign function in Matlab
sign(x) returns a matrix the same size as x. If the dimensions of x (and therefore sign(x)) are N-1 x 1 and the dimensions of D2...

7 jours ago | 0

Answered
How to do correlation between each row of two matrices?
The default correlation coefficient which corr calculates is described here (the Pearson linear correlation coefficient): https...

7 jours ago | 1

| accepted

Answered
how to get cartesian equation from parametric equation
Maybe something like this? syms t x y eqns = [x == 10*t^2; y == 2*t^2]; out = subs(eqns(2), t, rhs(isolate(eqns(1), t))); wh...

7 jours ago | 0

| accepted

Answered
Input data, round down, loop variable
How does this work? (I'm assuming T.y is monotonically increasing) % example table: x = randi(10,59,1); y = cumsum(rand(59,1)...

8 jours ago | 1

| accepted

Answered
How do I plot on the same figure from 2 functions?
When you name a variable in your function figure, you can no longer access the function figure(). For example: >> figure = 1; ...

8 jours ago | 0

| accepted

Answered
How can I remove the error "unable to perform because the indices on the left side are not compatible with the size of the right side"
It seems like you are calling sum on 2D arrays, so each output would be a row vector, which you can't store within Output(i). Yo...

8 jours ago | 0

| accepted

Answered
Y axis in scientific form
How does this work for you? ax = axes; plot(ax, 1:10, (1:10).^10) % get rid of 'x 10^N' in corner ax.YAxis.Exponent = 0; ...

8 jours ago | 0

| accepted

Answered
how to skip the index of array
Alternatively, idx = [1,2,1,2,4]; N = 6; % max index out = repmat(1:N, numel(idx), 1)'; out = reshape(out(out ~= idx), [],...

8 jours ago | 0

| accepted

Answered
Matrix dimensions must agree
A is a 4x9 array, so A' is a 9x4 array. A.*A' This tries to use element-wise multiplication on A and A', but they aren't the s...

8 jours ago | 0

Answered
How do I fix my legend?
You can still use the same idea as Ruger28's comment, just pull the pertinent values from mutualInfoTotal: baseNames = {'T9C11'...

8 jours ago | 0

| accepted

Load more