Respondida
Generate all possible permutations including repeats
F = [0,1,2]; n_values = numel(F); n_combos = n_values^n_values; M = F(1+dec2base(0:n_combos-1,n_values)-'0'); disp(M);

casi 3 años hace | 0

Respondida
generate all possible upper triangular matricies with variables
g = [1,NaN,NaN; 0,1,NaN; 0,0,1]; v = [0,1,2]; n_values = numel(v); slots = find(isnan(g)); n_slots = numel(slots); n_...

casi 3 años hace | 0

| aceptada

Respondida
Ordering a matrix as x increases and y increases
square = unique(square,'rows'); works to remove repeated rows, yes. In I uderstand the ordering you want, it is to sort by y-co...

casi 3 años hace | 0

| aceptada

Respondida
Keyboard Shortcut to move through the tabs in a Tab Group menu (Request to improve code)
That code can be simplified a bit: % Window key press function: UIFigure function kpf(app, event) if ~isequal(event.Mod...

casi 3 años hace | 2

| aceptada

Respondida
Problem substituting a for loop with vectorization
% just to have some values to run with: l1 = 1; l2 = 1; alfa1 = 0; alfa2 = 0; k1 = linspace(0,2*pi,360); k2 = linspace...

casi 3 años hace | 1

| aceptada

Respondida
call function with fewer parameters
"what happen if i call function with 1 parameter instead of 3" The answer depends on what the function does with the parameters...

casi 3 años hace | 0

| aceptada

Respondida
restructure data table based on date and other categorical variables
T = readtable('data_test.csv') T_summary = groupsummary(T,{'Site','Date'},@(x){x},{'d18O','Depth'}); T_summary = removevars(T_...

casi 3 años hace | 0

| aceptada

Respondida
How I can split a two column data into chunks like this snap shot
S = load('Data_Chunking.mat'); A = S.Alg2_mLat_maxEE; C = 9; % chunk size [M,N] = size(A); % in case A is not an integ...

casi 3 años hace | 0

| aceptada

Respondida
Question about headerlines commend
Check why fopen in this line FID = fopen([DataFolder,'\',DataList(n)], 'r') returns -1 for FID. Better yet, use the second ou...

casi 3 años hace | 0

Respondida
Insert data to table
temps = table(datetime(rand(10,1),'ConvertFrom','datenum'),rand(10,1)) a_different_table = table([1;2;3;4;5]) start_row = 6; ...

casi 3 años hace | 0

| aceptada

Respondida
duplicate tab:how know reference object?
Better than findobj() is to capture the output from copyobj(): new_obj = copyobj(obj,newtab);

casi 3 años hace | 0

| aceptada

Respondida
tabs created in the tabgroup
numel(tg.Children) where tg is your tabgroup.

casi 3 años hace | 0

| aceptada

Respondida
fprintf formatting problem with cell and array matrix 2
fracs = ... [1.080799513888714E-32 0 0.62466759170135333 0.0742119108820972 0 0 0 ... 0 0 0.30112049741654717; 8.1862...

casi 3 años hace | 0

| aceptada

Respondida
check if tab exist
"i want check if app.Tab_Instrum_Aggreg exist or not" isprop(app,'Tab_Instrum_Aggreg')

casi 3 años hace | 0

| aceptada

Respondida
how to extract slider's value
You are storing the slider object in an array. hslide is the array, and hslide(i) is the slider. When you try to get the value, ...

casi 3 años hace | 0

| aceptada

Respondida
Clean data and extraction
T = readtable('data.xlsx'); T.Properties.VariableNames = num2cell(char(64+(1:size(T,2)))); % set H = G where H == 0 idx = T...

casi 3 años hace | 0

| aceptada

Respondida
problem with columnWidth..how solve it
It seems like you are confusing the table data object with the uitable graphics object. If you have a uitable (UIT) whose data ...

casi 3 años hace | 0

Respondida
Is there a property to reset timer
I think stop() then start(), like you've done, is the best way.

casi 3 años hace | 0

| aceptada

Respondida
How to only fill one line of a matrix with a given formula
function A = specialMatrix(n) A = zeros(3,n); A(1,:) = 1; A(2,1:2:end) = 20; A(3,1:3:end) = 30; ...

casi 3 años hace | 0

Respondida
How to get all unique positions in a cell array?
c = num2cell(unique(vertcat(c{:}),'rows'),2);

casi 3 años hace | 0

| aceptada

Respondida
How do I identify elements in a table/matrix and sort them in descending order?
M = magic(5) % some matrix [v,idx] = sort(M(:),'descend'); [r,c] = ind2sub(size(M),idx); result = [r, c, v]

casi 3 años hace | 1

Respondida
How Do I Create a Mean Filtered Image using For Loops?
[gRow, gCol, ~] = size(grayImg); gRow and gCol are non-negative scalar integers. if mod(gRow, 3) < 3 mod(_,3) of something wi...

casi 3 años hace | 1

| aceptada

Respondida
Interpolation on multiple data sets
Have you tried interpn? thrusts = 0.1:0.3:1; altitudes = 10000:1000:12000; mach_numbers = 0.25:0.1:0.75; [T,A,M] = ndgrid(...

casi 3 años hace | 0

Respondida
menu not showing elements in string array
menuOption = menu('Choose file.', savedFileNames{:}, 'Return to previous menu'); This passes the elements of savedFileNames as ...

casi 3 años hace | 0

| aceptada

Respondida
extracting rows of data
inputFile = '07010000002.txt'; data = readmatrix(inputFile); figure hold on plot(data(:,1)) min_idx = find(islocalmin(d...

casi 3 años hace | 1

Respondida
How to iterate through a cell array and link elements in particle tracking?
This plots using only the "good" (i.e., non-zero) indices from Index_matrix{jj}. Note that three additional particle tracks are ...

casi 3 años hace | 0

Respondida
Given vector with N entries, generate all combinations with K entries such that K > N, vector entries can repeat
syms a b v = [a b]; n = numel(v); k = 4; result = v(dec2base(0:n^k-1,n)-'0'+1)

casi 3 años hace | 0

Respondida
Plotting piecewise function over two periods
t = 0:0.001:0.8; ih = zeros(size(t)); idx = t < pi/10; ih(idx) = 500*sin(10*t(idx)).^2; plot([t t+0.8],[ih ih])

casi 3 años hace | 0

| aceptada

Respondida
How do you plot a line on a function defined by colors?
img = imread('image.png'); imagesc(img) hold on contour(mean(img,3),'k')

casi 3 años hace | 0

Respondida
fprintf formatting problem with cell and array matrix
See the attached modified script and resulting .txt file. The file-writing section is reproduced here: prodNums = length(prodN...

casi 3 años hace | 0

Cargar más