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

mehr als 2 Jahre vor | 0

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

mehr als 2 Jahre vor | 0

| akzeptiert

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

mehr als 2 Jahre vor | 0

| akzeptiert

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

mehr als 2 Jahre vor | 2

| akzeptiert

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

mehr als 2 Jahre vor | 1

| akzeptiert

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

mehr als 2 Jahre vor | 0

| akzeptiert

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

mehr als 2 Jahre vor | 0

| akzeptiert

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

mehr als 2 Jahre vor | 0

| akzeptiert

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

mehr als 2 Jahre vor | 0

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

mehr als 2 Jahre vor | 0

| akzeptiert

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

mehr als 2 Jahre vor | 0

| akzeptiert

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

mehr als 2 Jahre vor | 0

| akzeptiert

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

mehr als 2 Jahre vor | 0

| akzeptiert

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

mehr als 2 Jahre vor | 0

| akzeptiert

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

mehr als 2 Jahre vor | 0

| akzeptiert

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

mehr als 2 Jahre vor | 0

| akzeptiert

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

mehr als 2 Jahre vor | 0

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

mehr als 2 Jahre vor | 0

| akzeptiert

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

mehr als 2 Jahre vor | 0

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

fast 3 Jahre vor | 0

| akzeptiert

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

fast 3 Jahre vor | 1

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

fast 3 Jahre vor | 1

| akzeptiert

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

fast 3 Jahre vor | 0

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

fast 3 Jahre vor | 0

| akzeptiert

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

fast 3 Jahre vor | 1

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

fast 3 Jahre vor | 0

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

fast 3 Jahre vor | 0

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

fast 3 Jahre vor | 0

| akzeptiert

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

fast 3 Jahre vor | 0

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

fast 3 Jahre vor | 0

Mehr laden