回答済み
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...

2年以上 前 | 0

| 採用済み

回答済み
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...

2年以上 前 | 1

回答済み
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...

2年以上 前 | 0

| 採用済み

回答済み
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; ...

2年以上 前 | 1

| 採用済み

回答済み
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 ...

2年以上 前 | 0

回答済み
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...

2年以上 前 | 0

回答済み
Logical Operator with cell
names = {'ITC','ITD','ITH'}; LOAD = []; for ii = 1:numel(names) LOAD = [LOAD; str2double(reg_freight_train(contains(reg_f...

2年以上 前 | 0

回答済み
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...

2年以上 前 | 0

回答済み
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...

2年以上 前 | 0

回答済み
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 ...

2年以上 前 | 0

回答済み
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...

2年以上 前 | 0

回答済み
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...

2年以上 前 | 0

回答済み
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...

2年以上 前 | 0

| 採用済み

回答済み
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...

2年以上 前 | 0

| 採用済み

回答済み
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...

2年以上 前 | 0

| 採用済み

回答済み
How to plot an elliptic curve in MATLAB?
f = @(x,y)y.^2-x.*(x-a^p).*(x+b^p); fimplicit(f)

2年以上 前 | 1

回答済み
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...

2年以上 前 | 1

| 採用済み

回答済み
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 [...

2年以上 前 | 0

| 採用済み

回答済み
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,'$ ...

2年以上 前 | 0

回答済み
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...

2年以上 前 | 1

回答済み
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...

2年以上 前 | 1

| 採用済み

回答済み
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)))

2年以上 前 | 0

回答済み
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)))

2年以上 前 | 0

回答済み
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...

2年以上 前 | 0

回答済み
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 ...

2年以上 前 | 1

回答済み
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...

2年以上 前 | 0

| 採用済み

回答済み
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...

2年以上 前 | 0

回答済み
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...

2年以上 前 | 0

回答済み
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(...

2年以上 前 | 0

| 採用済み

回答済み
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...

2年以上 前 | 1

| 採用済み

さらに読み込む