Beantwortet
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...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 2 Jahre vor | 1

Beantwortet
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...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
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; ...

mehr als 2 Jahre vor | 1

| akzeptiert

Beantwortet
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 ...

mehr als 2 Jahre vor | 0

Beantwortet
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...

mehr als 2 Jahre vor | 0

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

mehr als 2 Jahre vor | 0

Beantwortet
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...

mehr als 2 Jahre vor | 0

Beantwortet
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...

mehr als 2 Jahre vor | 0

Beantwortet
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 ...

mehr als 2 Jahre vor | 0

Beantwortet
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...

mehr als 2 Jahre vor | 0

Beantwortet
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...

mehr als 2 Jahre vor | 0

Beantwortet
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...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 2 Jahre vor | 0

| akzeptiert

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

mehr als 2 Jahre vor | 1

Beantwortet
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...

mehr als 2 Jahre vor | 1

| akzeptiert

Beantwortet
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 [...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
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,'$ ...

mehr als 2 Jahre vor | 0

Beantwortet
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...

mehr als 2 Jahre vor | 1

Beantwortet
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...

mehr als 2 Jahre vor | 1

| akzeptiert

Beantwortet
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)))

mehr als 2 Jahre vor | 0

Beantwortet
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)))

mehr als 2 Jahre vor | 0

Beantwortet
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...

mehr als 2 Jahre vor | 0

Beantwortet
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 ...

mehr als 2 Jahre vor | 1

Beantwortet
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...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 2 Jahre vor | 0

Beantwortet
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...

mehr als 2 Jahre vor | 0

Beantwortet
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(...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 2 Jahre vor | 1

| akzeptiert

Mehr laden