Réponse apportée
Load multiple files one by one into a subfolder or Extract data from strut
matpath = 'C:..\..sol_file\'; matfiles = dir(fullfile(matpath ,'*.mat')); full_file_names = fullfile(matpath,{matfiles.name}...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
stem plot line width inconsitencies
Seems like a renderer issue. You can try switching to the 'painters' renderer. You can see in the tests below that only the 'pai...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Adding values of each row
data = [1;3;6;8] result = cumsum(data,1) Or, if you want to overwrite your data with the new value: data = cumsum(data,1)

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Issue with fprintf in a loop
fprintf returns the number of bytes written. It's always zero in this case because '%.2n' is not a valid format. Instead, use s...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
For loop with two conditions
for n = -2:2 if n == 0 % use D_n_0 else % use D_n end end

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
i want to generate a sequence of n numbers
start = -4; increment = 2; N = 8; sequence = start + (0:N-1)*increment;

plus de 2 ans il y a | 0

Réponse apportée
I want to avoid dynamically naming my tables after a join.
Maybe something like this will help: T = table(["AAA"; "BB"; "BBB"; "CCC"; "CCC"; "CCC"; "DDD"], ... [datetime('2023-07-07...

plus de 2 ans il y a | 1

| A accepté

Réponse apportée
Plot 3D Contour plot on Surface Plot
Here I specify x and y as well as the contour levels in the contour3 call. Adjust as desired. %% Main Script. %% Clear the MAT...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Multiple plots in a single figure not working correctly for pole plots
Try this: cs = crystalSymmetry('321'); ss = specimenSymmetry('1'); filename = 'pcrystal_standard.csv'; fileID = fopen(file...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
For loop producing correct values but returning zeros
"it resets the previous numbers to zero" That's not correct. The first few iterations' results appear to be zero on the plot be...

plus de 2 ans il y a | 1

Réponse apportée
How do I make this graph in just one expression?
Each of the following two methods does the plotting with one line of code. ir = [0.03485,0.0294,0.0198,0.0074]; t_ir=[0.372,0....

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Plot multiple columns of table with datetime
P = array2table(rand(288,3),'VariableNames', ["generator", "consumer", "storage"]); current_time = datetime('now','Format','y...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
MATLAB letter grade from Excel file
You need to define which numeric grades map to which letter grades. For example: letters = 'F':-1:'A'; letters(letters == 'E')...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
eval for string to variable
Since var is a string (as opposed to character vector), when you concatenate it with character vectors, those character vectors ...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Split a Table at every nth row
T = array2table(rand(96014,10)) % approximately 96000 rows in the table One approach: Split T into tables that are exactly 2800...

plus de 2 ans il y a | 0

Réponse apportée
I'm new to MATLAB GUI and want to ask for help
m-files created with GUIDE require an associated .fig file of the same name. You should go back to where you found the m-file an...

plus de 2 ans il y a | 0

Réponse apportée
Looping through tables in my workspace, plotting them, and saving a picture of the plot.
The error message, "Dot indexing is not supported for variables of this type." indicates that some code is trying to access a co...

plus de 2 ans il y a | 1

| A accepté

Réponse apportée
Save in App designer text area value not as .txt, .dat, or .csv file - Matlab
writecell(app.XYZfilecontentTextArea.Value, 'E:\SCH.xyz', 'QuoteStrings',false, 'FileType','text');

plus de 2 ans il y a | 1

Réponse apportée
Help debugging real time plotting issues
"Why does the plot have lines connected to the first datapoint[?]" Because tData(1) is always 1/samplingRate. I guess you shou...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
I'm trying to graph data from an html file and I'm unsure how to load and graph it.
url = "https://coyote.eece.maine.edu/ece101/hw/umhab-137-iridium.html"; T = readtable(url); head(T) tail(T) alt = str2doub...

plus de 2 ans il y a | 0

Réponse apportée
fprintf automatic spacing for strings of different lenghts
cities = ["Pasadena","Urbana-Champaign","Cambridge"]; path = 1:numel(cities); d = [3200 1600 4800]; % using a vector of distan...

plus de 2 ans il y a | 2

| A accepté

Réponse apportée
VLOOK UP Function for MatLab - Closest Match
col1 = 1; val1 = 12; col2 = 2; [~,idx] = min(abs(data{:,col1}-val1)); result = data{idx,col2};

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
How to change the scale of color bar to discrete ?
You can use a colormap that has duplicate colors wherever the spacing between the levels is 0.1: x = [-7.22 -6.70 -6.19 -5.67 -...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
how to plot a time series from row 1000 to 3000
LD6 = load('output_a_f_LL_bus5.mat'); Data = LD6.Id_6.Data; t = LD6.t.Time; figure idx = t >= 0.1 & t <= 0.3; plot3(Data(id...

plus de 2 ans il y a | 1

| A accepté

Réponse apportée
log scale not displayed correctly in horizontal bar graph
Use axis ([1 4500000 0 2]); or put whatever lower x-limit you want to use instead of 1. Zero cannot be rendered on log...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
Shuffle matrix based on column elements
Here's one way: data = readmatrix('logfile_example-30-09-23.xlsx') [trial_idx,trial_id] = findgroups(data(:,3)); n_trials = n...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
Manipulating data from a table in app designer
tabla = table; % ... app.UITable.Data = tabla; The uitable's Data is a table variable, so you need to get the data out of the...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
How can i make the output hide and show only when the output when the cursor is placed
This will toggle the visibility of a text object when you click on its corresponding pixel in the image. All text objects are in...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
How to avoid unnecessary legends in the graph?
Set the 'HandleVisibility' of the ConstantLines created by xline() to 'off'. figure('Position',[10 10 1200 500]); plot(1:51940...

presque 3 ans il y a | 0

Réponse apportée
Find a value in structure
yourStruct = struct('e1',{1 2 3 18841},'e2',{1 2 18841 4},'e3',{1 2 3 4}) valueToFind = 18841; fieldsToSearch = {'e1', 'e2', '...

presque 3 ans il y a | 0

Charger plus