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

alrededor de 4 años hace | 0

| aceptada

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

alrededor de 4 años hace | 0

| aceptada

Respondida
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,[])

alrededor de 4 años hace | 0

| aceptada

Respondida
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]) = ...

alrededor de 4 años hace | 2

| aceptada

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

alrededor de 4 años hace | 0

| aceptada

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

alrededor de 4 años hace | 0

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

alrededor de 4 años hace | 0

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

alrededor de 4 años hace | 0

| aceptada

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

alrededor de 4 años hace | 0

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

alrededor de 4 años hace | 1

| aceptada

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

alrededor de 4 años hace | 0

| aceptada

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

alrededor de 4 años hace | 0

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

alrededor de 4 años hace | 0

| aceptada

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

alrededor de 4 años hace | 0

| aceptada

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

alrededor de 4 años hace | 0

| aceptada

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

alrededor de 4 años hace | 1

| aceptada

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

alrededor de 4 años hace | 0

| aceptada

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

alrededor de 4 años hace | 1

| aceptada

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

alrededor de 4 años hace | 1

| aceptada

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

alrededor de 4 años hace | 0

| aceptada

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

alrededor de 4 años hace | 0

| aceptada

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

alrededor de 4 años hace | 1

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

alrededor de 4 años hace | 0

| aceptada

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

alrededor de 4 años hace | 0

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

alrededor de 4 años hace | 0

| aceptada

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

alrededor de 4 años hace | 0

| aceptada

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

alrededor de 4 años hace | 0

| aceptada

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

alrededor de 4 años hace | 0

| aceptada

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

alrededor de 4 años hace | 0

| aceptada

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

alrededor de 4 años hace | 0

Cargar más