Réponse apportée
convert two columns( one real number and the other is imaginary but without (i) symbol) in txt file to complex number and one column.
Use xlsread or what other import functions you care to use to read the data depending on how much of the header info you need, t...

plus de 7 ans il y a | 0

Réponse apportée
How to use an an if statement which has two criteria to be met to create a new table
>> W=[1 2 1 2 1 3 2 0 0 2].'; >> F=[0 0 2 2 0 0 3 3 0 0].'; >> ix=(W<2) | (W>1 & F>0); >> [W(ix) F(ix)] ans = 1 0 ...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
Read multiple csv and plot
formatSpec = '%s%s%s%s%s%s%s%s%s%s%s'; csv_dir = uigetdir(' '); d=dir(fullfile(csv_dir, '*.csv')); for i=1:numel(file_list) ...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
How to get data from file to matrix?
>> A=importdata('ionos.txt'); >> whos A Name Size Bytes Class Attributes A 351x35 ...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
Create a folder and save it with a field name
>> newfoldername=['newfolder_' DATA.Site]; mkdir(fullfile('C:\MicrogridDesignTool\Projects',newfoldername')) Error using fullf...

plus de 7 ans il y a | 0

Réponse apportée
Create a folder and save it with a field name
Would be easier to see the actual struct via whos DATA to ensure we follow the actual construction, but basically if Data.Sit...

plus de 7 ans il y a | 0

Réponse apportée
why the coordinates start from 800. want it to start from 0 . and the origin point in the left down like usual.
imshow by default uses size() of the image x- and y- dimensions +/-0.5 as the axis x- and y-limits. The data are plotted on the...

plus de 7 ans il y a | 0

Réponse apportée
How to add multiple graphs onto one graph
And what, specifically, is wrong with ... code that generates x,y line 1 code that generates x,y line 2 code that generates ...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
How to generate a file name by combining variable characters based on the input of the matlab?
You're on right track... fmt= 'output_file_%s_value%0.2f_%03d_s%03d.txt'; % use fixed width with leading zeros so will sort nu...

plus de 7 ans il y a | 0

Réponse apportée
Compare to rows and delete matching rows
[~,ib]=ismember(A,B(:,1)); B(ib,:)=[];

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
Making date regular in timetable
Q1. Because you created a timetable with the time vector that is last day of each calendar quarter month over a period of years...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
How can I add label to each column to numeric matrix and write it to excel
xlswrite requires each cell of the output cell array contain either a string or a numeric; otherwise that cell will be silently ...

plus de 7 ans il y a | 0

Réponse apportée
Add les than or equal to inequality to my legend
xlabel('3\geq2') ylabel('2\leq3') See section link to 'TeX' interpreter at doc text TMW could make it easier to find from t...

plus de 7 ans il y a | 2

| A accepté

Réponse apportée
Compile mulitple csv files into one large table
You're overwiting Data every iteration... source_dir = 'directory_name'; source_files = dir(fullfile(source_dir,'*.csv')); Da...

plus de 7 ans il y a | 0

Réponse apportée
How do I make a legend for data organized into colours in a bar plot?
OK, with your data file... [Yield,Elements] = xlsread('test.xlsx'); [YS,iY]=sort(Yield,'descend'); % index to pl...

plus de 7 ans il y a | 3

| A accepté

Réponse apportée
How do I make a legend for data organized into colours in a bar plot?
The bar plot/object in Matlab is a really, Really, REALLY difficult thing to work.with, unfortunately. A single bar plot has on...

plus de 7 ans il y a | 1

Réponse apportée
moving files from one folder to an other
ix=10; % don't bury data inside code; use variables movefile(fullfile(f_raw(ix).folder,f_raw(ix).name),B)...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
how to place a legend in best corner?
Give this a try as a first cut...written for a one-line plot as is and takes the legend, axis handles. Generalized, it could ...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
adding legend that is comes from a variable
LEGEND() requires text, not numeric data for the legend text... hL=legend(num2str(eta(:),'%.4f')); % salt format string to...

plus de 7 ans il y a | 2

| A accepté

Réponse apportée
import textfile with both numbers and characters into array while skipping part of the file's content
With the above analysis of the file structure and ignoring the remainder of the file as there are also no delimiters other than ...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
how to place a legend in best corner?
Try legend(___,'Location','best') ML tries to avoid the most data it can if it can find a location that the legend doesn't occ...

plus de 7 ans il y a | 2

Réponse apportée
Can I add a table that immediately has data taken from it and added to a graph?
NMax=826; % the max length or have to figure dynamically d=dir(fullfile('yourworki...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
Importing or reading a column with both text and numerical data using textscan
Not too much grief... :) t=readtable('MIKE.txt'); % read raw data t.p01m=cellfun(@str2double...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
Replace string values with another string value.
fntwoscomp=@(v,n) dec2bin(mod(v,2.^n),n); >> fntwoscomp(-3:3,5) ans = 7×5 char array '11101' '11110' '11111'...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
how to find input value of a function knowing one of the outputs?
Q_Htgt=5; % the target solution value fnQ=@(QG) getGUE(T_hwi,T_set,T_ext,QG)-Q_Htgt...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
how to plot time stamps
Revamp your input parsing a little... fmt=['%s %d %d %d %f %*s']; % string type, ID, HR, MN, S.SSS, blank record fi...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
plot each line in a matrix
plot (t,sw.') Just transpose the array to use plot()'s builtin facility to plot each column as a variable. It's the power of t...

plus de 7 ans il y a | 4

Réponse apportée
How can i concatenate two or more flaoting numbers to a single number without rounding them ?
s=sprintf('%g',n); s=strrep(s,'0.',''); s(s=='.')=[]; >> disp(s) 123451256401250014 >>

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
any way to plot scatter-line with different symbol
Not by controlling the 'marker' properties in a single scatter call, no, unfortunately. Those are global for the object. It's ...

plus de 7 ans il y a | 0

Réponse apportée
Median Value of specific data by index
xc=categorical(x(:,1)); % convert indices to categorical (not mandatory, sometimes convenient) [G,grp]=findgroups(...

plus de 7 ans il y a | 0

| A accepté

Charger plus