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

más de 9 años hace | 0

| aceptada

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

más de 9 años hace | 0

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

más de 9 años hace | 0

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

más de 9 años hace | 2

| aceptada

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

más de 9 años hace | 0

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

más de 9 años hace | 0

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

más de 9 años hace | 0

| aceptada

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

más de 9 años hace | 1

| aceptada

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

más de 9 años hace | 0

Respondida
Importing data from excel, matlab is interpreting a time incorrectly
They're read correctly, that's just the internal representation of how Excel stores dates that isn't consistent with Matlab. ...

más de 9 años hace | 0

Respondida
Can anyone explain this coding?
The variable _visionk_ ends up holding the average of a measure of the distance (max-min) scaled by the max of the subsections o...

más de 9 años hace | 1

| aceptada

Respondida
Merge array cells after creation to one cell
No. The cell array is required to be rectangular; the _content_ of some cell can be empty as you have, but the cell array itsel...

más de 9 años hace | 0

Respondida
Error in Logical Array multiplication
It is not a Matlab bug; it is owing to the definition of matrix multiplication not making sense for logical variables; the logic...

más de 9 años hace | 0

Respondida
export a variable to multiple csv files
csvwrite('file1.csv',x(:,1:2)) csvwrite('file2.csv',x(:,3:4)) File names and subscript expressions can all be variables ...

más de 9 años hace | 0

| aceptada

Respondida
How to replace all the strings of a csv file with NaN using textscan and "TreatAsEmpty" ?
OTOH, >> fid=fopen('ziad.txt'); >> fmt=repmat('%s',1,8); >> c=textscan(fid,fmt,'collectoutput',1); >> fid=fclose(f...

más de 9 años hace | 0

Respondida
binning histogram and obtaining the proportions
Simplest is probably to just return the bin of the observation via |*histcounts*| or |*histc*|, whichever you're using with the ...

más de 9 años hace | 0

Respondida
column operation based on frequency of element in a mtrix
>> u=unique(x(2,:))); >> [~,bin]=histc(x(2,:),u); >> [accumarray(bin.',x(1,:)).';u] ans = 3 15 2 3 ...

más de 9 años hace | 0

| aceptada

Respondida
Plotting trendlines on plot with 2 y-axes using plotyy
hAx=plotyy(.....); % plot your two axes, keeping the handles to same ... hold(hAx(2),'on') % set HOLD status fo...

más de 9 años hace | 0

Respondida
Function like text() but with auto placement like legend?
No, altho I can guess the desire...would be kind of a nice touch if Matlab could/would automagically locate a desirable place to...

más de 9 años hace | 1

| aceptada

Respondida
Syntax for modifying 'LineWidth' in graph?
Not enough context to tell for certain but looks like from variable name that _ax_ is *probably* an axes handle...if so, the 'Li...

más de 9 años hace | 0

Respondida
Create struct before function or in/with function?
In Matlab, you can go even further and function mytruct = myfunction(folder) cd(folder) mystruct.data = magic(5) ...

más de 9 años hace | 1

Respondida
Surface plot with semilog z-axis: how to keep the same axis limit for iterative plots?
Use zlim([zMIN zMAX]) that you want before beginning the iteration. Didn't read carefully enough, sorry...you're usin...

más de 9 años hace | 1

| aceptada

Respondida
What does u and v represent in a quiver plot?
_"A quiver plot displays velocity vectors as arrows with components (u,v) at the points (x,y)."_ The (u,v) are the x- and y- ...

más de 9 años hace | 0

Respondida
Find Data in Table
Using categorical for the string columns has some advantages. I fixed up your listing above to be able to read as a table via ...

más de 9 años hace | 1

| aceptada

Respondida
Is there a way for matlab to find a function in a file that doesn't match the file name?
No. Local functions (those functions in a file after the first which normally(*) is named the same as the m-file containing it)...

más de 9 años hace | 1

| aceptada

Respondida
How can I deal with the large dimension array effectively ?
Actually, |FGL1_nmvlpq(ii1,i3,i4,in,im,i1,il,ip,iq)| is _9_ -dimensional, not 8. Let's see, >> 9^30/1024/1024/1024/1024*8 ...

más de 9 años hace | 2

Respondida
How to do double strings match in single statement
If you use a cell array, that'll require *cellfun* > isOK=~cellfun(@isempty,strfind(C(:,1),'Normal')) & [[C{:,2}]>=20].'; ...

más de 9 años hace | 0

Respondida
How do i find all elements of value R in a matrix that are neighboring an element of value K?
One approach... [r,c]=size(A); A[false(1,c)); diff(A,[],2)== 2]; A[true(1,c)); diff(A,[],2)==-2]; A[true(r,1) ...

más de 9 años hace | 0

Respondida
Finding a peak in .mat file......
See doc findpeaks % in Signal Processing Toolbox If don't have (and can't easily acquire) SP TB, post back...

más de 9 años hace | 0

Respondida
How can I count the number of working days between 2 dates?
See <http://www.mathworks.com/help/finance/busdays.html <busdays>> but need Financial Toolbox

más de 9 años hace | 0

| aceptada

Cargar más