Respondida
How to change values of x axis from numbers to dates
x = -10:0.1:10; y = sin(x); hF=figure; % keep handle to figure plot(x,y) hAx(1)=gca; ...

más de 7 años hace | 1

| aceptada

Respondida
Correlating Two Arrays Using Correcoef
There's at least one NaN in the second variable...you don't give any information about which is which. >> spd=5*rand(500,1);tlt...

más de 7 años hace | 0

| aceptada

Respondida
Polynomial 2nd degree
Taking a shot that the presumption earlier is the correct one-- xy=xlsread('ML.xlsx','sheet2'); % read the data into array ...

más de 7 años hace | 0

Respondida
Writing first and last line of each cell
Just have to handle the special case outside the loop... xx=zeros(length(xxMM)+1,6); xx(1,:)=xxMM{1,:}(1,:); for i=1:length(x...

más de 7 años hace | 0

| aceptada

Respondida
Plotting graph of negative values of array in integral2 with 3 variables
The functional is invariant upon the the loop; remove the definition from inside the loop Use meaningful name for the degrees a...

más de 7 años hace | 1

Respondida
Finding pythagoras triples when only c is known
Somewhat more rudimentary would be UP=fix(sqrt(Csq-1)); % can't be bigger ignoring degenerate case of (sqrt(Csq^2),0) for i=1:...

más de 7 años hace | 1

Respondida
Plot A Graph With Asymptotic Behavior
ymaxCX = max(max(CX), limCSss); yminCX = min(min(CX), limCSss); Just getting an overall min/max value of the data in vector C...

más de 7 años hace | 0

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

más de 7 años hace | 0

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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 2

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

más de 7 años hace | 0

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

más de 7 años hace | 0

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

más de 7 años hace | 0

| aceptada

Respondida
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); ...

más de 7 años hace | 0

| aceptada

Respondida
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)...

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 5

| aceptada

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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 0

| aceptada

Pregunta


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

más de 7 años hace | 0 respuestas | 1

0

respuestas

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

más de 7 años hace | 1

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

más de 7 años hace | 1

| aceptada

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

más de 7 años hace | 2

| aceptada

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

más de 7 años hace | 2

| aceptada

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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 3

| aceptada

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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 1

| aceptada

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

más de 7 años hace | 0

| aceptada

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

más de 7 años hace | 0

Cargar más