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

más de 2 años hace | 0

| aceptada

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

más de 2 años hace | 1

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

más de 2 años hace | 0

| aceptada

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

más de 2 años hace | 1

| aceptada

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

más de 2 años hace | 0

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

más de 2 años hace | 0

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

más de 2 años hace | 0

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

más de 2 años hace | 0

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

más de 2 años hace | 0

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

más de 2 años hace | 0

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

más de 2 años hace | 0

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

más de 2 años hace | 0

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

más de 2 años hace | 0

| aceptada

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

más de 2 años hace | 0

| aceptada

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

más de 2 años hace | 0

| aceptada

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

más de 2 años hace | 1

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

más de 2 años hace | 1

| aceptada

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

más de 2 años hace | 0

| aceptada

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

más de 2 años hace | 0

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

más de 2 años hace | 1

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

más de 2 años hace | 1

| aceptada

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

más de 2 años hace | 0

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

más de 2 años hace | 0

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

más de 2 años hace | 0

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

más de 2 años hace | 1

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

más de 2 años hace | 0

| aceptada

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

más de 2 años hace | 0

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

más de 2 años hace | 0

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

más de 2 años hace | 0

| aceptada

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

más de 2 años hace | 1

| aceptada

Cargar más