Réponse apportée
How to add data to cursor tip, BUT each piece of data is from a separate computation or table lookup. (Not the idx, not the coordinates.)
One way to do that is to use the array Payoff as an input to myDataCursorCallback. Something like this: % Curse02.m % Add data...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
How to perform elementwise multiplication between two matrices with different size or summation between two matrices with the same size
f = 1:10; x = -22:1:22; y = -22:1:22; [u,v] = meshgrid(x,y); whos Note that u and v are 45x45 matrices, so each has 2025 el...

plus de 2 ans il y a | 1

Réponse apportée
contourf plot value not corresponding to the legend bar value
"It looks like anything above .25 is blue, and anything below is red." This is happening because of the levels that contourf ch...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Round down to nearest 100
Divide by 100, then floor() or fix() (depending on how you want to handle negative numbers), then multiply by 100. x = 568; ...

plus de 2 ans il y a | 1

| A accepté

Réponse apportée
Compile multiple cells in a single vector including empty cells as zero elements.
H = { [] [] [5] [] [3] } % original array H(cellfun(@isempty,H)) = {0} % if empty, replace the empty array ...

plus de 2 ans il y a | 0

Réponse apportée
Re: "Multilevel access cells data"
"my Cell x is defined as: Cell x = [3x3 double], [4x4 double]" x = {magic(3),magic(4)} % create x x{:} % sh...

plus de 2 ans il y a | 0

Réponse apportée
Logical Operator with cell
names = {'ITC','ITD','ITH'}; LOAD = []; for ii = 1:numel(names) LOAD = [LOAD; str2double(reg_freight_train(contains(reg_f...

plus de 2 ans il y a | 0

Réponse apportée
populating the cells of a 10*1 column vector cell array
You can try this, where filename is the (absolute or relative) path to your spreadsheet file: M = readmatrix(filename); % M: 10...

plus de 2 ans il y a | 0

Réponse apportée
UITable Individual Cell Editing in App Designer
"when a value was changed and a new row was added the cell would go back to the original value" Because ADDButtonValueChanged d...

plus de 2 ans il y a | 0

Réponse apportée
Can I arrange a double array into cell array based on discontinuity of values?
a1=[1 2 3 4 5 10 11 12 13 18 19 20 21 22 23]; a2 = split_vector(a1) a1=[1 2 3 4 5 6 7 8 9 10 11 12 13 18 19 20 21 22 23]; a2 ...

plus de 2 ans il y a | 0

Réponse apportée
How to access and perform calculations on cell array of durations
% a table where one column is a cell array of durations: t = table([10;13;16],num2cell(duration([0;1;2],[0;0;0],[0;0;0])),'Vari...

plus de 2 ans il y a | 0

Réponse apportée
how to average over specific dates
% a datetime vector spanning several years: dt = datetime('14-Jul-2018 00:01:00'):datetime('14-Jul-2024 00:01:00') % wave heig...

plus de 2 ans il y a | 0

Réponse apportée
groupcounts and sum of data in another array in the same order
A = [10, 11, 12, 10, 11, 12, 13, 11, 15, 10], B = [0.5, 1, 1, 0.5, 0.5, 0.5, 1, 1, 1, 0.5] [counts,vals] = groupcounts(A(:)) s...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Use variable to find column in table
% a table with 5 columns, one of which is a table with 4 columns: t = table(rand(12,1),rand(12,1), ... array2table(rand(12...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
drop-down menu in uitable
As the warning suggests, if you want to use ColumnFormat your Data can't be a table. Try using a cell array for Data, as in: pl...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
How to plot an elliptic curve in MATLAB?
f = @(x,y)y.^2-x.*(x-a^p).*(x+b^p); fimplicit(f)

plus de 2 ans il y a | 1

Réponse apportée
permute with exact repeats
Here's one way: x = [1 2 3]; n = 5; % generate a matrix M whose rows are all possible % sets of n elements from x: m = nu...

plus de 2 ans il y a | 1

| A accepté

Réponse apportée
Extract row data from a complex data file
Here's one way: filename = 'complex_data.txt'; L = readlines(filename); % n_line = 24; % define line to read str = 'dN [...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Find line containing word in a mixed format txt file
filename = 'file.txt'; fid = fopen(filename,'r'); data = fread(fid,[1 Inf],'*char'); fclose(fid); idx = strfind(data,'$ ...

plus de 2 ans il y a | 0

Réponse apportée
2D Random Walk
rand(1,2) produces a 1x2 vector: rand(1, 2) Seems like you want a scalar instead: rand(1, 1) % or just rand() Making that ch...

plus de 2 ans il y a | 1

Réponse apportée
How to plot a 2D filled colour contour plot depth profile?
load SALT s = permute(SALT(35,:,:),[3 2 1]); contourf(s) set(gca(),'YDir','reverse') xlabel('Longitude(?) Index') ylabe...

plus de 2 ans il y a | 1

| A accepté

Réponse apportée
I am trying to get my answer to Display but it wont let me
syms f(x) f(x) = (x^3) - (7*x) + 6; x=solve(f(x)==0,x); fprintf('the roots will be [%s]\n',join(string(x)))

plus de 2 ans il y a | 0

Réponse apportée
I am trying to get my answer to Display but it wont let me
syms f(x) f(x) = (x^3) - (7*x) + 6; x=solve(f(x)==0,x); fprintf('the roots will be [%s]\n',strjoin(string(x)))

plus de 2 ans il y a | 0

Réponse apportée
I am trying to get my answer to Display but it wont let me
syms f(x) f(x) = (x^3) - (7*x) + 6; x=solve(f(x)==0,x); str = sprintf('%s ',x); str(end) = []; fprintf('the roots will be...

plus de 2 ans il y a | 0

Réponse apportée
How to change color of point depending on side of a line?
x = rand(20,1); y = rand(20,1); xv = 0.4; yv = 0.6; colors = [1 0 0; 0 1 0; 0 0 1]; r_idx = x < xv; g_idx = x >= xv ...

plus de 2 ans il y a | 1

Réponse apportée
How do I add values to a vector?
If you want to insert a zero element at each of the locations specified by gld_off, in turn, you can do this: X = [0.0001385640...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
hello, i have such a type of data per 30 days in one file.by using fgets,fscanf,str2num,strcmp i need to plot temp vs height
The following uses fscanf, fgets, str2num, and strcmp: filename = 'file.txt'; fid = fopen(filename,'r'); counter = 0; wh...

plus de 2 ans il y a | 0

Réponse apportée
Unrecognized function or variable
if Lab5c(i)>Lab5c(i-1) && Lab5c(i)>=Lab5c(i+1) && Lab5c(i)> 488000 If that condition is never true then the block inside will n...

plus de 2 ans il y a | 0

Réponse apportée
Change The structure of a Variable
Here's one thing you can try: % loadfile: 1x67 struct with one field, each containing a 2x277 cell array C_temp = struct2cell(...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Plot data from nested structure
load Proj_metrics Something like this may have been what you intended: Nparticipants = numel(metrics.sub); %Create a 3D mat...

plus de 2 ans il y a | 1

| A accepté

Charger plus