Answered
Trying to delete rows in a table based on specific values using indexing
Instead of this: idx = any(PARTidMat<738341.7917 | PARTidMat>738342,3); % any along the 3rd dimension Do this: idx = PARTidMa...

4 years ago | 0

| accepted

Answered
How to avoid a newline in sprintf
sj = 3; Consider the difference between what you have now: {'Choose a subject', ... '(Last chosen subject:' sprintf('%d)'...

4 years ago | 0

| accepted

Answered
Reshape a matrix based on indices placed on another matrix
v = rand(81,1); % something like v(1:10:end) = NaN; % your 81-by-1 vector reshape(v,9,[])

4 years ago | 0

| accepted

Answered
How do I index individual columns in an array?
load high_perspective_taking.mat % original: high_perspective_taking % 0 <-> 4, 1 <-> 3: high_perspective_taking(:,[1 4]) = ...

4 years ago | 2

| accepted

Answered
Connect points of specific height that is a string
load InsideOutTable.mat DBearbeitungBorderInfillInsideOutStand19S1.Pulvergefoerdert = (DBearbeitungBorderInfillInsideOutStand...

4 years ago | 0

| accepted

Answered
How to create Random Binary Number with fix amount of 1 and 0?
bin_len = 30; num_1 = 4; % initialize numeric vector of 30 zeros bnout = zeros(1,bin_len); % place ones at 4 random indice...

4 years ago | 0

Answered
Setting resolution for getframe?
Setting the resolution with getframe is not supported, but you can use exportgraphics or print, both of which support setting th...

4 years ago | 0

Answered
how to re-write a text file by skipping Ist column.
Maybe this is sufficient: data = readmatrix('text_file.txt'); writematrix(data(:,2:end),'new_text_file.txt')

4 years ago | 0

| accepted

Answered
Filtering an Array for multiple different conditions
I think you may have the wrong impression about what happens when you change TFpos inside the loop. Specifically, changing the v...

4 years ago | 0

Answered
add column of sequential numbers to table
Here's one way to do it (shown using a smaller table): T = array2table(rand(15,4)) T.new_column = (1:size(T,1)).'

4 years ago | 1

| accepted

Answered
How to remove ticks from the secondary axis in the example below?
loglog(1:10000) ax = gca; set(ax, ... 'XGrid','on', ... 'YGrid','on', ... 'GridLineStyle','-', ... 'XMin...

4 years ago | 0

| accepted

Answered
tiledlayout no spacing display in 2x3 grid
imshow effectively sets the aspect ratio so that the image doesn't look distorted. If you want to have no space between the til...

4 years ago | 0

Answered
How do I split a MATLAB table into seperate tables by date?
Here's one way: t = table( ... {'2022-05-21';'2021-05-21';'2022-05-21';'2022-06-01';'2022-06-01';'2022-06-04'}, ... [...

4 years ago | 0

| accepted

Answered
Fill up a variable number of rows to match a certain size
Results = rand(194,1); % a random 194-by-1 vector disp(Results(end-1:end)); % show the last two elements % extend with zeros...

4 years ago | 0

| accepted

Answered
How do I convert a colorbar to a legend for multiple colors representing categories?
figure('Colormap',cool(8)) caxis([1 8]) colorbar()

4 years ago | 0

| accepted

Answered
How to deal with legend for multiple curves in one figure?
One way is to set the DisplayName of each line when you plot it: names = { 'phi = 0 & psi = 0' 'phi = psi' 'phi ...

4 years ago | 1

| accepted

Answered
Trouble using strcmp in Matlab
Assigning to Opt_Sub on each iteration of the for loop overwrites whatever was assigned to Opt_Sub on previous iterations of the...

4 years ago | 0

| accepted

Answered
Histogram bin location to place text for categorical data
You can use h1.Categories instead of h1.BinEdges % a guess at what your X and categorical_edges_x look like categorical_edges_...

4 years ago | 1

| accepted

Answered
How to conditionally pick the rows of tow datasets?
A = [1, 6, 3; 8, 11, 1; 4, 2, 0; 8, 1, 5; 9, 2, 1] B = [8, 4; 7, 1; 2, 5; 1, 8; 9, 7; 4, 6] C = A; [ism,idx] = ismember(A(:,1...

4 years ago | 1

| accepted

Answered
excel and matlab problem
T = readtable('EXCEL.xlsx'); NAMES = T.(1) ; AvgMarks = mean(table2array(T(:,2:end)),2) ; Grades = cell(size(T,1),1); ...

4 years ago | 0

| accepted

Answered
Plot a 2d figure for a complicated function
vplc=0.25;delta=2.5;tau_max=44000;Ktau=0.045;%tauP=0.027; kc=0.1; kh=0.05;Vp=0.9;Kbar=0.000015;kp=0.15;gamma=5.5;kb=0.4; Vpm=0...

4 years ago | 0

| accepted

Answered
How to find x values of specified y point on the graph ?
x = [1,2,3,4,5]; y = [6,7,8,9,10]; y_point = 6.34; x_point = interp1(y,x,y_point); plot(x,y); hold on plot(x_point,y_p...

4 years ago | 1

Answered
How to Filter Array Based on Values in a Different Array?
% some random lat/lon/stat matrices lat = randi([-90 90],5,10) lon = randi([-180 180],5,10) stat = randi([-3 1],5,10) % get ...

4 years ago | 0

| accepted

Answered
How to populate a list box with .mat files in a specified file path?
Instead of this: set(handles.ChooseVersionListBox,'string',files.name); % tries to update listbox w/ .mat file names Try this:...

4 years ago | 0

Answered
Plotting function with differenting constant
a=[1,2,3];%,50,300]; % using just the first 3 a values, for this demonstration for i=1:length(a) ...

4 years ago | 0

| accepted

Answered
How to find the length of intersection of rows of a matrix?
A = [ 1 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0...

4 years ago | 0

| accepted

Answered
For loop to save doubles in .mat files
load_mat = load('some_mat_file.mat') % create a new structure, "new_mat", which contains % only the 20x1 doubles from load_ma...

4 years ago | 0

| accepted

Answered
Loop input variables into function to get the various output in table
Something like this maybe? % your initial table input_table = array2table([ ... 41 62 92 17 3 7 -2; ... ...

4 years ago | 0

| accepted

Answered
Find Max values in each row
A1 = [ ... 200 300 400 500 600; ... 1.2 1.3 1.4 1.6 1.2; ... 1.5 1.9 2.3 1.5 1.2]; Use the index you get to inde...

4 years ago | 0

| accepted

Answered
How do I only keep the rows that match the values of the rows in a different list?
load low_condition load valid_low_IDs valid_low_IDs contains character vectors that appear to be file names: valid_low_IDs S...

4 years ago | 0

Load more