photo

Tommy


Last seen: 9 mois il y a Actif depuis 2017

Followers: 0   Following: 0

Statistiques

All
  • 6 Month Streak
  • Pro
  • Knowledgeable Level 5
  • First Answer
  • Commenter
  • Solver

Afficher les badges

Feeds

Afficher par

Réponse apportée
Calculating survival probabilities from Mortality tables in MATLAB
readtable() returns a table which should contain your variables. Try [a,elx] = lifetablefit(data.x, data.lx);

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
Issue with defining inputs in classdef and getting properties updated
For your second line: [position,velocity,current] = motor.input(5,10); If you want input() to accept values for the voltage an...

plus de 4 ans il y a | 1

Réponse apportée
Why is corr/corrcoef returning NaNs?
You can use corr(OptimismBias, AmbigTolG, 'rows', 'complete') to ignore the NaN values.

plus de 4 ans il y a | 3

| A accepté

Réponse apportée
Can I detect array index inside setter method?
"For indexed assignment: obj.PropName(n) = val; MATLAB: Invokes the get method to get the property value Performs the indexe...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
How to add histogram to series of scattered plot on the same plot?
scatterhist() uses different syntax than scatter(). It seems like you need to enter all the data at once, as vectors, and then u...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
How to extract one plot from multiple plots?
Assuming you have the figure handle, how about something like this? % setup f = figure; for idx = 1:8 ax = subplot(4,2,i...

plus de 4 ans il y a | 0

Réponse apportée
how to detect a keyboard key in a while loop using a figure
You could use the figure's KeyPressFcn, possibly combined with some of the ideas below: myFig = figure('KeyPressFcn', @myKeyPre...

plus de 4 ans il y a | 0

Réponse apportée
Averaging values in Column B based on serial date in column A
Does it need to be a loop? I believe this will work: groups = findgroups(yourArray(:,1)); avg = splitapply(@mean, yourArray(:,...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Accessing an ROI move listener in another function so to delete it
Assuming you don't want to delete the ellipse, you could instead delete the listener within your button's callback function. You...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Convert a vector into a matrix (row wise)
From the reshape() docs, for the syntax B = reshape(A,sz) "The elements in B preserve their columnwise ordering from A." If...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
Combining x and y arrays and converting subsequent values
Assuming x and y are formatted like the following... [x,y] = meshgrid(1:1920,1:1080); ...then how about this? q = nan(size(x)...

plus de 4 ans il y a | 0

Réponse apportée
Create matrix with different type of data and sort it based on one of its columns
For the following example: % example... A = strings(10,1); B = rand(10,1); you could use a table: % combine and sort... T ...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Patch color error "Vectors must be the same length."
The docs linked by Geoff mention that you can specify an n-by-1-by-3 array of RGB values (for n number of faces). I've defined c...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
How to format output to exponential notation
This should work: fprintf('At voltage = %.2E nV\n',CurData(1,C)*10^9) If you don't want the plus sign: val = CurData(1,C)*10^...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
How to return index of started specific pattern from array/matrix(column/rows)
See here: https://blogs.mathworks.com/loren/2008/09/08/finding-patterns-in-arrays/#7 idx = strfind(a, ex);

plus de 4 ans il y a | 1

Réponse apportée
Change labels positions for pie chart
One option: https://www.mathworks.com/matlabcentral/answers/94801-why-do-the-pie-labels-overlap-when-the-wedges-are-very-small-...

plus de 4 ans il y a | 2

Réponse apportée
How to fill a matrix column by column better than by a for loop?
How about something like this? xx = 0:0.1:1; nxx = numel(xx); nyy = 10; xm = repmat(xx',1,nyy); base = linspace(0,1,nyy);...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
How to make the program more flexible
Here's a function that places an M x N grid of Xs within a rectangle defined by pos, as well as a few lines which use that funct...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
Replacing Values in Matrix with NaN's based on Row and Column
Possibly, you could use sub2ind() to convert your rows and columns to linear indices: ind = sub2ind(size(yourMatrix), yourRows,...

plus de 4 ans il y a | 0

Réponse apportée
Get the middle point of a matrix
Possibly MATLAB's convolution functions will be faster: % 1D case: B = conv(A, ones(2,1), 'valid') / 2; % 2D case: B = con...

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
Opening a figure saved in .fig with several plots and working on them separately
You could obtain handles to each of the axes within your figure and go from there: fig = openfig('myfig.fig'); ax_handles = fi...

plus de 4 ans il y a | 0

Réponse apportée
Error When Using Writetable Function
It seems like writetable() has trouble handling the case where a variable in your table contains a cell which itself contains an...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Indexing a matrix in matlab according to conditions set on other matrices
Here's one way: result = (a <= 5 & b >= 6) .* c;

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
Plot with intervals for x axis
I believe stairs() is what you want: https://www.mathworks.com/help/matlab/ref/stairs.html

plus de 4 ans il y a | 0

Réponse apportée
changing uislider position by script
sld = uislider(fig,... 'Orientation', 'vertical',... 'Position',[ 100 100 3 100],... ...

plus de 4 ans il y a | 0

Réponse apportée
how to define a path in saveas command
Possibly like this? pathdatasave = 'E:\matlab'; saveas(gcf,sprintf('%s%03d.png', pathdatasave, i));

plus de 4 ans il y a | 0

Réponse apportée
Disable Datatips on click
Not the greatest solution, but you could make the datatips invisible until your timer deletes them: dcm = datacursormode; dcm....

plus de 4 ans il y a | 1

| A accepté

Réponse apportée
Index exceeds the number of array elements (5).
Likely a typo in line 56: As(6)=-l^2*cos(phi); %Spring node 6 % ^ should be Af? As it is, Af only h...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Why aren't my lines showing up on my graph?
Specify a marker to show scalar values. For example, a circle: plot (GT, IP, 'ro') Or are you trying to plot a range of pressu...

plus de 4 ans il y a | 0

Réponse apportée
Plot only adjacent points that are close to each other
logidx = abs(diff(Y)) < 0.022; dY_idx = find([logidx 0] | [0 logidx]); Y_adj_close = Y( dY_idx ); Seems to me that every part...

plus de 4 ans il y a | 0

| A accepté

Charger plus