Answered
ERROR unable to convert 'string' value to 'int64'
Yr = 1900 + Yr; fileNew = fopen(newFileName,'w'); Mnth = string(Mnth); T = [Yr Mnth LowTemp HighTemp Precip]; You've got a n...

7 years ago | 0

Answered
I'm wanting to change my formatting to scientific and output values in a table
Your table isn't what you think it is...study the output carefully and the orientation of the data in the table... HINT: You n...

7 years ago | 0

| accepted

Answered
how to perform xor of two bits in matab
See doc bitxor to do the logical operation on the content of the variable in its internal storage pattern; you can convert the...

7 years ago | 1

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

7 years ago | 0

Answered
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 years ago | 1

| accepted

Answered
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 years ago | 0

| accepted

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

7 years ago | 1

| accepted

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

7 years ago | 0

Answered
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 years ago | 0

Answered
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 years ago | 0

Answered
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 years ago | 0

| accepted

Answered
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 years ago | 0

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

7 years ago | 0

| accepted

Answered
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 years ago | 0

| accepted

Answered
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 years ago | 0

Answered
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 years ago | 2

| accepted

Answered
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 years ago | 0

Answered
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 years ago | 3

| accepted

Answered
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 years ago | 1

Answered
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 years ago | 1

| accepted

Answered
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 years ago | 0

| accepted

Answered
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 years ago | 2

| accepted

Answered
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 years ago | 0

| accepted

Answered
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 years ago | 2

Answered
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 years ago | 1

| accepted

Answered
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 years ago | 1

| accepted

Answered
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 years ago | 1

| accepted

Answered
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 years ago | 1

| accepted

Answered
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 years ago | 0

| accepted

Answered
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 years ago | 4

Load more