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

2年以上 前 | 0

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

2年以上 前 | 0

| 採用済み

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

2年以上 前 | 0

| 採用済み

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

2年以上 前 | 2

| 採用済み

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

2年以上 前 | 1

| 採用済み

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

2年以上 前 | 0

| 採用済み

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

2年以上 前 | 0

| 採用済み

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

2年以上 前 | 0

| 採用済み

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

2年以上 前 | 0

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

2年以上 前 | 0

| 採用済み

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

2年以上 前 | 0

| 採用済み

回答済み
tabs created in the tabgroup
numel(tg.Children) where tg is your tabgroup.

2年以上 前 | 0

| 採用済み

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

2年以上 前 | 0

| 採用済み

回答済み
check if tab exist
"i want check if app.Tab_Instrum_Aggreg exist or not" isprop(app,'Tab_Instrum_Aggreg')

2年以上 前 | 0

| 採用済み

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

2年以上 前 | 0

| 採用済み

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

2年以上 前 | 0

| 採用済み

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

2年以上 前 | 0

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

2年以上 前 | 0

| 採用済み

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

2年以上 前 | 0

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

2年以上 前 | 0

| 採用済み

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

2年以上 前 | 1

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

2年以上 前 | 1

| 採用済み

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

2年以上 前 | 0

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

2年以上 前 | 0

| 採用済み

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

2年以上 前 | 1

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

2年以上 前 | 0

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

2年以上 前 | 0

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

2年以上 前 | 0

| 採用済み

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

2年以上 前 | 0

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

2年以上 前 | 0

さらに読み込む