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

fast 3 Jahre vor | 0

| akzeptiert

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

fast 3 Jahre vor | 0

| akzeptiert

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

fast 3 Jahre vor | 0

| akzeptiert

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

fast 3 Jahre vor | 0

| akzeptiert

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

fast 3 Jahre vor | 0

| akzeptiert

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

fast 3 Jahre vor | 0

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

fast 3 Jahre vor | 1

| akzeptiert

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

fast 3 Jahre vor | 0

| akzeptiert

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

fast 3 Jahre vor | 0

| akzeptiert

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

fast 3 Jahre vor | 1

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

fast 3 Jahre vor | 0

| akzeptiert

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

fast 3 Jahre vor | 0

| akzeptiert

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

fast 3 Jahre vor | 0

| akzeptiert

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

fast 3 Jahre vor | 0

| akzeptiert

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

fast 3 Jahre vor | 0

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

fast 3 Jahre vor | 0

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

fast 3 Jahre vor | 1

| akzeptiert

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

fast 3 Jahre vor | 1

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

fast 3 Jahre vor | 0

| akzeptiert

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

fast 3 Jahre vor | 0

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

fast 3 Jahre vor | 2

| akzeptiert

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

fast 3 Jahre vor | 0

| akzeptiert

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

fast 3 Jahre vor | 0

| akzeptiert

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

fast 3 Jahre vor | 1

| akzeptiert

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

fast 3 Jahre vor | 0

| akzeptiert

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

fast 3 Jahre vor | 0

| akzeptiert

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

fast 3 Jahre vor | 0

| akzeptiert

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

fast 3 Jahre vor | 0

| akzeptiert

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

fast 3 Jahre vor | 0

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

fast 3 Jahre vor | 0

Mehr laden