回答済み
How to properly extract data from text file.
The first one is (relatively) easy -- you set _'ReadVariableNames',true_ whose meaning per documentation is "the first row of th...

9年以上 前 | 0

| 採用済み

回答済み
How do I format data in a table
L=max(cellfun(@length,A.colheaders)); % longest header length for width N=size(A.data,2); % number co...

9年以上 前 | 0

| 採用済み

回答済み
How to call a function correctly.
[phi_x,phi_y]=do_flower_image(flowers,alpha,iters) Well, if iflowers=do_flower_image(flowers,alpha,iters); worked (...

9年以上 前 | 0

| 採用済み

回答済み
problem with writting data to excel from matlab
>> help xlswrite ... A — Data to write matrix | cell array Data to write, specified as a two-dimensional numeric ...

9年以上 前 | 0

| 採用済み

回答済み
How to return the fit as a function object?
Under 'Fit' menue, 'Save to Workspace' will save a |*cfit*| object of your choice to name. Not precisely sure what you're then ...

9年以上 前 | 0

回答済み
How to call a series of values normally distributed around an average value (and within a range)?
out=mu+sigma*randn(1); doc randn % for details As far as bounding outputs, the RN variate is not bounded albeit proba...

9年以上 前 | 0

回答済み
How to create loop that plots data from a file depending on the length of data and with specific pattern
L=length(Flow1); N=fix(L/10); % how many complete datasets are there? ip=0; % index, plots ia=0; ...

9年以上 前 | 1

| 採用済み

回答済み
How to Remove files that don't match string?
If anywhere in the filename, then UnwantedStrings={'Z1P', 'Z2P', and 'Z1G'}; Files=Files(~ismember(upper(Files),'Unwante...

9年以上 前 | 0

回答済み
Can someone explain to me how I can format the function to output only Max and Half_max into an excel file, for each file in the loop? Thanks!
OK, after all the above discussion, here's the function I tested on a file with two CSV-separated numeric columns. It also ha...

9年以上 前 | 0

| 採用済み

回答済み
Plotting inside for loop using if
Reorganized your code to do as suggested above... G=200; %mass flux[kg/m^2*s] Pred=0.31052; %re...

9年以上 前 | 1

| 採用済み

回答済み
How do I create a vector with a string and an iterative counter
_"Each contour line definition follows this pattern:"_ C(k) = [level x(1) x(2)... numxy y(1) y(2)... ] So...

9年以上 前 | 0

| 採用済み

回答済み
I have the index value from a plot. Now what?
If you plotted with plot(x,y) then x(cursor_info.DataIndex) is the x value at that index point (which is also th...

9年以上 前 | 0

回答済み
How to filter data from table using multiple strings
>> t=table(categorical(c),'variablenames',{'Code'}); % put your data back into the table from whence it came >> summary(t)...

9年以上 前 | 1

| 採用済み

回答済み
how to read a letter from a string in a cell?
Just as in any other cell addressing; use the indexed addressing mode-- >> whos s % just happened to be in workspace at th...

9年以上 前 | 0

回答済み
Filenames from uigetfiles or dir strip of their accents.
I = dicomread(fullfile(pad, char(list(i)))); or I = dicomread(fullfile(pad, list{i}))); There really aren't carat...

9年以上 前 | 0

| 採用済み

回答済み
How can i find the best fit points from the input and output data
"_I interpolated these x and y points to increase the samples [and] then applied linear least square algorithm..."_ Since *i...

9年以上 前 | 0

回答済み
How can I join chars to a string vector?
Surprisingly, as so often since documentation in Matlab is example- instead of syntax- driven, the actual rule one looks for isn...

9年以上 前 | 0

回答済み
Sorting the complex array elements with imaginary part along with it.
*EDIT:* Incorporate Andrei's contribution and add for arrays--dpb >> A A = 1.0000 + 2.0000i 3.0000 + 1.0000i ...

9年以上 前 | 1

回答済み
Piece of R code translate to Matlab
Been too long, but iirc, looks like: Z=2*rand(Ni,1)+Pbar; P=2*rand(Ni,1)+Pbar; IOW, as near as I can recollect, the t...

9年以上 前 | 0

回答済み
Not just another dynamic variable naming question! Generating a new string and using it in a command.
_"Each ### is a patient and each of the roman numerals is a separate ECG channel. Each of the leads has hundreds of rows of dat...

9年以上 前 | 1

| 採用済み

回答済み
How do I record all cases where two columns sum to a third?
function out=jhaller(m) m=m.'; % easier to work by row instead of column R=size(m,1); out=nan(3,R*(R-1)/2); ...

9年以上 前 | 0

回答済み
Eliminating an entire point on a plot both for data and on the axis
Well, the most trivial would be i60=60/df; % index of 60 hz in array idel=delF/df; % the delta indices for the rang...

9年以上 前 | 0

| 採用済み

回答済み
ok so I am trying to create a legend that can change if the number of datasets included in the read excel file is changed. How would I go about doing this? Here is the full code so you can get an idea of whats going on.
The answer to the question is just hL=legend(name); % legend for each name read as long as you keep internal order cons...

9年以上 前 | 0

回答済み
I need help with permutations.
What's wrong with [r,c]=size(m); mm = bsxfun(@times,permute(m,[r,c,1]),permute(m,[c,r,1])); *ADDENDUM* Which, if y...

9年以上 前 | 0

回答済み
convert mat-files into CSV.files
d=dir(fullpath(dirname,'*.mat')); for i=1:length(d) load(d(i).name % will leave whatever variable is in mat-file i...

9年以上 前 | 2

| 採用済み

回答済み
how to speed up datestr conversion?
Two alternatives-- dn=datenum(c,'HH:MM:SS.FFF') if stick with outmoded |datenum| or switch to the newer |datetime| class...

9年以上 前 | 0

回答済み
Can someone explain to me how I can format the function to output only Max and Half_max into an excel file, for each file in the loop? Thanks!
As I suggested earlier, you need to add some array handling/outputs to your function... MaxHalf=zeros(length(d),1); % prea...

9年以上 前 | 0

回答済み
Plot selected variables according to flag
_"I have three variables x1, x2 and x3..."_ And there's the crux of the problem--do _NOT_ create sequentially-name variables ...

9年以上 前 | 0

| 採用済み

回答済み
Why does my loop only run on the first file in the folder?I'm new to matlab and programming.
Dunno, can't see your terminal from here... :) First guess is that length(cont) is 1. Set a breakpoint in the editor and u...

9年以上 前 | 1

| 採用済み

回答済み
Need help about error for Area
You've got |nargchk| in the argument list as first problem... function area = area2d(x1,y1,x2,y2,x3,y3) error(nargchk(...

9年以上 前 | 0

さらに読み込む