Answered
I need to classify my result in catagories
N=1.5*ones(size(ma)); N(abs(ma)==45 | abs(ma)==135)=-0.5; ... The rest should be self-evident from the above; lett as "exerci...

7 years ago | 0

Answered
Getting the correct y-intercept and gradient for a trend line using 'fit'
Looks quite right to me...the intercept is where the fitted line will cross (intercept) the y-axis at x=0...that point is way an...

7 years ago | 0

| accepted

Answered
How to add a column to an existing file?
Text sequential files are, well, "sequential" You can't just add in the middle by either column or line/record. data=importdat...

7 years ago | 2

Answered
is it possible to copy a file on itself?
That isn't copying a file onto itself; there's nothing to prevent you doing what you want. Your copyfile command isn't referenc...

7 years ago | 0

Answered
Ploting every n-th result in a for loop
v=2;L=100; N=10; for t=0:0.01*N/v:L/v clf ... To introduce a 10-fold reduction...

7 years ago | 0

Answered
How can I plot hourly data in the same figure?
Use the features of Matlab to your advantage...granted, it takes some "time in grade!" to learn one's way around! :) As a gene...

7 years ago | 0

| accepted

Answered
Create a table with Revenue by financial year such as 2017-18
t=readtable('chindamo.xlsx'); % read the input table data t.Code=categorical(t.Code); ...

7 years ago | 0

| accepted

Answered
I can't delete plot and line in a figure
... p1 = line([xr xr],[0 f(xr)]); line([xr xr],[0 f(xr)]) ... x = [-10 0.01 10]; y = (x-xr).*df(xr)...

7 years ago | 0

| accepted

Answered
marker size difference between 'plot' and 'scatter' function
Per the documentation, scatter marker size property is marker proportional to area while the line marker property is proportiona...

7 years ago | 5

| accepted

Answered
How to convert each row of the matrix into a Character array, without using a for command?
Preallocate B may help just tad... Alternatives to loop include B=cellstr(num2str(A)); but what is end purpose for doing the ...

7 years ago | 0

| accepted

Answered
Black and Grey Bars in Barplot
Need to apply the colormap to something... hAx=subplot(2,2,1); clrs = [0 0 0; 0.9 0.9 0.9]; colormap(hAx,clrs); hB=bar([perc...

7 years ago | 0

| accepted

Question


Categorical variable in cell array?
This seems absurdly trivial but I haven't found the right syntax...I was trying to add a categorical variable to a cell array to...

7 years ago | 0 answers | 1

0

answers

Answered
reading a very large number of csv files
Try https://www.mathworks.com/matlabcentral/fileexchange/10959-sort_nat-natural-order-sort and see if it will solve your probl...

7 years ago | 1

Answered
rank keywords using length
[~,il]=sort(l,'descend'); K>> s(il) ans = 16×1 cell array {'third-greatest'} {'humanitarian' } {'Brussel...

7 years ago | 1

| accepted

Answered
Get the first row in a table with grouped data
[~,ig]=findgroups(D.key); [~,ig]=ismember(ig,D.key); results in: >> D(ig,:) ans = 3×4 table key Date Height ...

7 years ago | 2

| accepted

Answered
Converting table to matrix
" from excel using readtable and now I need it into matrix form so I can plot the data a certain way " More than likely that is...

7 years ago | 2

| accepted

Answered
How to import a txt file from a subfolders (not included in path)
You pass a qualified filename -- it can be fully-qualified or partially, as long as it is unambiguous and refers to the correct ...

7 years ago | 0

| accepted

Answered
reading content of a text file by readtable
Given the long conversation after the first rudimentary "throwaway" solution, I'll post a more general and robust solution as se...

7 years ago | 3

| accepted

Answered
counting the number of values in table if the condition satisfies??
xx = categorical({'computer'; 'car'; 'mobile'; 'bus'; 'tree'; 'jeep'}); u='car'; [ia,ib]=ismember(u,xx); if ia count=numel...

7 years ago | 0

| accepted

Answered
Read in dates (for timestamp) from file names
Just parse the filename itself... fmt='yyyyMMMdd_HH-mm-ss'; tstr=cellstr(strvcat(d.name)); file_timestamps=cellfun(@(x) datet...

7 years ago | 0

| accepted

Answered
How to extract numeric values form multiple text files into a single dynamic array?
It's always easier if we can see a piece of a file so know exactly what the form is, but... Your error is that you're trying to...

7 years ago | 1

| accepted

Answered
Export cell array into Excel
C=num2cell(cell2mat(data_1.')); xlswrite(file,C,sheet,range)

7 years ago | 0

| accepted

Answered
reading content of a text file by readtable
function t=readRunFar(file) % return table containing data from input file fid=fopen(file,'r'); % read the two sections -...

7 years ago | 0

Answered
Can I use "fitnlm" for multiple regression ? and How?
Well, I take that back...actually you could do it with fitlm if you do a change of variable... u1=x2.^n; u2=x3.^n; t=table(x...

7 years ago | 0

Answered
How do I make a smooth curve using the following data?
Presuming you first convert your data to arrays from cell array... plot(x1,y1,'x',x2,y2,'s') % plot the data only X1=l...

7 years ago | 1

Answered
read file with ascii characters and binary data on one single line
As noted in the comment, it's bizzaro way to have done, but the following seems to work... >> l=fgetl(fid);while ~contains(l,'#...

7 years ago | 0

| accepted

Answered
Counting occurrences of a pair of numbers in a logical vector
Mayhaps one can get more cleverer, but I'm all for just "git 'er done!" ix=reshape(find(A),2,[]).'; B=zeros(size(A)); for i=1...

7 years ago | 2

| accepted

Answered
Plotting scale bar with vertical margins
X=[0.2,0.1]; Y=[0.9,0.75]; E=[0.15,0.05]; % positions, bar length about midpint hEb=errorbar(X,Y,E,'horizontal','b.', 'l...

7 years ago | 0

| accepted

Answered
Alternative to 'find' which won't return multiple values?
If you're using R2017b or later... [~,i10mx]=maxk(topfit,10); % return 10 largest positions in topfit vector topstac...

7 years ago | 1

| accepted

Answered
how can I write two matrix into the same csv file
There's nothing in the documentation for writematrix that should have led you to think you could possibly do what you're asking ...

7 years ago | 0

| accepted

Load more