Risposto
read text file - header and numerical part
Q1: A. See fgets to keep newline B: Don't need ExtractBetween, use ExtractAfter; then don't need the actual \n in the d...

circa 4 anni fa | 0

| accettato

Risposto
How to remove compare 2 arrays so that when there is a in a column, it removes the column in another array
You have only one row logical but three rows of labels??? But, assuming that's expected and the need is to remove all columns t...

circa 4 anni fa | 1

| accettato

Risposto
How to solve this errror about reading in complex numbers?
Previously answered what appears to be virtually identical Q? <answers/1818965-how-to-read-only-last-2-columns-of-csv-format-fi...

circa 4 anni fa | 0

Risposto
How do you insert a row or a column into a cell array?
No differently than with any other array -- although inserting in the middle somewhere requires copying (although with cell arra...

circa 4 anni fa | 3

| accettato

Risposto
How to label X-axis on bar graph?
cats=categorical(["Baseline";compose('Food deprivation(Week%d)',[1:3].')]); results=randi(20,4,1); bar(cats,results) The prob...

circa 4 anni fa | 1

| accettato

Risposto
How do I use a variable assigned in one function to call another function?
Forget global exists; for virtually all cases, it's not the better solution. Instead, use the return values your function(s) ca...

circa 4 anni fa | 0

| accettato

Risposto
one column in to multiple column
It's not possible to have a table with different number or rows by variable(column); MATLAB is NOT a spreadsheet (which is agood...

circa 4 anni fa | 0

Risposto
Filling missing times in timetable with NaN using retime
load(websave('data.mat','https://www.mathworks.com/matlabcentral/answers/uploaded_files/1148080/data.mat')) ttD=data_site_num_t...

circa 4 anni fa | 0

Risposto
Axes not reconizing figure handle
hF=figure; hAx=axes(hF,'Position',[0.1300 0.3300 0.7750 0.700]); xlabel(hAx,'SomeText') ylabel(hAx,'MoreText') xlim(hAx,[0 3...

circa 4 anni fa | 0

| accettato

Risposto
Sorting Data into a Table
% make up some data N=randi(5,3,1); x=[];for i=1:numel(N),x=[x;i*ones(N(i),1)];end x=x(randperm(numel(x))) % the engine (cel...

circa 4 anni fa | 0

Risposto
Plotting a two peak model as a fitted line on a probplot.
Actually, when I had a few minutes to think about it, it's not too hard; you just have to define the associated CDF function to ...

circa 4 anni fa | 1

| accettato

Risposto
Suppose i have a 1000*24 binary vectors each having 4 ones and 20 zeros in each row .Now want to extract the spcific vectors that have ones only at the speific positions.
Is that two separate cases of 12:15 AND 14:17 or one case that includes both cases? And is it all or any that must be 1? V1=12...

circa 4 anni fa | 0

| accettato

Risposto
Folder names sorting issues after reading from directory
I've never noticed a case in which dir returned a list differering in order from that returned by the OS -- what if you look at ...

circa 4 anni fa | 0

Risposto
How to use num2str inside text with latex interpreter?
i=1; text(0.4,0.5,"L_{" + i + "}") i=i+1; text(0.4,0.4,"\it L_{" + i + "}") i=i+1; text(0.4,0.3,"\it L\rm_{" + i + "}") Va...

circa 4 anni fa | 1

Risposto
Reuse figure/axes properties from figure A for figures B,C,D
hAxGolden=gca; % the gold standard hF=figure; % create new figure hAx=copyobj(hAxGolden,hF);...

circa 4 anni fa | 0

Risposto
Loop through files of different length
When you compute what h is in samples (if sample rate varies, otherwise just set it as a constant), then [R,C]=size(ECGdata); ...

circa 4 anni fa | 1

| accettato

Risposto
I have a .txt file that I need to turn into a vector
v=readmatrix('YourFile.txt');

circa 4 anni fa | 0

Risposto
how to read only last 2 columns of csv format file?
data=readtable(websave('plot.csv','https://www.mathworks.com/matlabcentral/answers/uploaded_files/1147855/plot.csv'),'readvariab...

circa 4 anni fa | 0

Risposto
How do I get the line of best fit and its equation from multiple datasets?
Presuming the problem with the file location is resolved, a fresh start is in order -- readvars is not a good choice here it wou...

circa 4 anni fa | 0

Risposto
Represent the total mask usage data (for all counties) in a form of a pie chart
explode=[]; to not use the parameter; the empty cell array doesn't work, the empty double does; a logical array is expected.

circa 4 anni fa | 0

Risposto
How to fake an app handle in the arguments?
Use mustBeScalarOrEmpty validation function instead of fixed size would get past that hurdle. I've no klew whether it'll actua...

circa 4 anni fa | 0

| accettato

Risposto
Need help making a plot from data in Excel with three columns and 2000 rows, to get two variables on the same axis.
Size of data is of no matter to syntax -- if you can plot a vector of 5 elements, you can plot one of thousands... data=readmat...

circa 4 anni fa | 0

Risposto
Fastest way to index large arrays
With the lookup arrays structured as they are, you don't need a lookup at all; you can just calculate the row directly -- fnRow...

circa 4 anni fa | 0

| accettato

Risposto
organising data with fscanf
file=readlines(websave('data.txt','https://www.mathworks.com/matlabcentral/answers/uploaded_files/1145645/data.txt')); data=[];...

circa 4 anni fa | 1

| accettato

Risposto
Code to import every 50th line of .csv isn't working
That's hard way to go about it -- data=readmatrix('Plain_VHB_Cyclic_Test_1.csv','numheaderlines',2); data=data(1:50:end,:);

circa 4 anni fa | 0

| accettato

Risposto
How to adjust the position of the x-axis ticks and put the angle degree on the values of the x-axis ticks?
With all values in one decade, log plot gets pretty squished; you can set the xlim to just cover the actual range and then only ...

circa 4 anni fa | 0

Risposto
Why can't i change an excel file sheets during a loop in matlab
Because in ewb.Worksheets.Item(1).Name =[Varlist(1,a)] ; that's exactly what you told it to do -- rename Item(1) each time. U...

circa 4 anni fa | 0

| accettato

Risposto
Create a new excel file from trimmed data
Shure...just build a file name dynamically somehow instead of incrementing the sheet number as you did. FILES={'T04A', 'T04A_1'...

circa 4 anni fa | 0

| accettato

Risposto
Combine data from text files into 1?
Exact details for the easiest way to handle the three files would depend on how they're named/saved so as to keep the sets assoc...

circa 4 anni fa | 0

| accettato

Carica altro