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

casi 3 años hace | 0

| aceptada

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

casi 3 años hace | 0

| aceptada

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

casi 3 años hace | 0

| aceptada

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

casi 3 años hace | 0

| aceptada

Respondida
For loop with two conditions
for n = -2:2 if n == 0 % use D_n_0 else % use D_n end end

casi 3 años hace | 0

| aceptada

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

casi 3 años hace | 0

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

casi 3 años hace | 1

| aceptada

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

casi 3 años hace | 0

| aceptada

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

casi 3 años hace | 0

| aceptada

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

casi 3 años hace | 1

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

casi 3 años hace | 0

| aceptada

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

casi 3 años hace | 0

| aceptada

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

casi 3 años hace | 0

| aceptada

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

casi 3 años hace | 0

| aceptada

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

casi 3 años hace | 0

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

casi 3 años hace | 0

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

casi 3 años hace | 1

| aceptada

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

casi 3 años hace | 1

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

casi 3 años hace | 0

| aceptada

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

casi 3 años hace | 0

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

casi 3 años hace | 2

| aceptada

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

casi 3 años hace | 0

| aceptada

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

casi 3 años hace | 0

| aceptada

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

casi 3 años hace | 1

| aceptada

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

casi 3 años hace | 0

| aceptada

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

casi 3 años hace | 0

| aceptada

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

casi 3 años hace | 0

| aceptada

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

casi 3 años hace | 0

| aceptada

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

casi 3 años hace | 0

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

casi 3 años hace | 0

Cargar más