回答済み
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 ...

7年以上 前 | 1

| 採用済み

回答済み
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) ...

7年以上 前 | 0

| 採用済み

回答済み
How to get data from file to matrix?
>> A=importdata('ionos.txt'); >> whos A Name Size Bytes Class Attributes A 351x35 ...

7年以上 前 | 1

| 採用済み

回答済み
Create a folder and save it with a field name
>> newfoldername=['newfolder_' DATA.Site]; mkdir(fullfile('C:\MicrogridDesignTool\Projects',newfoldername')) Error using fullf...

7年以上 前 | 0

回答済み
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...

7年以上 前 | 0

回答済み
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...

7年以上 前 | 0

回答済み
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 ...

7年以上 前 | 0

| 採用済み

回答済み
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...

7年以上 前 | 0

回答済み
Compare to rows and delete matching rows
[~,ib]=ismember(A,B(:,1)); B(ib,:)=[];

7年以上 前 | 0

| 採用済み

回答済み
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...

7年以上 前 | 0

| 採用済み

回答済み
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 ...

7年以上 前 | 0

回答済み
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...

7年以上 前 | 2

| 採用済み

回答済み
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...

7年以上 前 | 0

回答済み
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...

7年以上 前 | 3

| 採用済み

回答済み
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...

7年以上 前 | 1

回答済み
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)...

7年以上 前 | 1

| 採用済み

回答済み
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 ...

7年以上 前 | 0

| 採用済み

回答済み
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...

7年以上 前 | 2

| 採用済み

回答済み
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 ...

7年以上 前 | 0

| 採用済み

回答済み
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...

7年以上 前 | 2

回答済み
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...

7年以上 前 | 1

| 採用済み

回答済み
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...

7年以上 前 | 1

| 採用済み

回答済み
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'...

7年以上 前 | 1

| 採用済み

回答済み
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...

7年以上 前 | 1

| 採用済み

回答済み
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...

7年以上 前 | 0

| 採用済み

回答済み
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...

7年以上 前 | 4

回答済み
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 >>

7年以上 前 | 0

| 採用済み

回答済み
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 ...

7年以上 前 | 0

回答済み
Median Value of specific data by index
xc=categorical(x(:,1)); % convert indices to categorical (not mandatory, sometimes convenient) [G,grp]=findgroups(...

7年以上 前 | 0

| 採用済み

回答済み
Plotting timetable data: how to add x-axis ticks, labels and gridlines on 1st and 15th day of each month
t=[datetime(2018,6,1):datetime(2019,3,1)].'; % build a sample dataset... tt=timetable(t,randn(size(t))+10); % j...

7年以上 前 | 2

| 採用済み

さらに読み込む