Respondida
How can I shift the elements in a vector without losing the elements? just shift the order
Sorta' inconsistent definition, but look at >> A=1:10; >> circshift(A(4:end-2),-2) % case 1 ans = 6 7 ...

más de 7 años hace | 0

Respondida
How to transform an array into a bottom triangle
On the above assumption, if V is the vector, then N=149; % array size parameter R=V(cumsum([N:-1:1])); ...

más de 7 años hace | 0

| aceptada

Respondida
Finding elements of an arrays having specified index numbers
Given you return the indices in vectors ix and iy, then V=A(sub2ind(size(A),ix,iy)); where A is the other array and V will be ...

más de 7 años hace | 2

| aceptada

Respondida
Use the index of an element of a subset to find its index in the large set?
tipPt=[2 3 2]; % the two located points smpPt=[2 3 1]; % return their locations in the two arrays, respectively ...

más de 7 años hace | 0

| aceptada

Respondida
vertical error bar in loglog plot
hEB=errorbar(x,A,err); hAx=gca; hAx.XScale='log'; hAx.YScale='log'; You'll have to have defined the error magnitude array, e...

más de 7 años hace | 0

| aceptada

Respondida
Having multiple lines in a character array for column labels in a heatmap
Unless TMW has finally fixed it, the TickLabel interpreter is pretty brain dead...you can do something like ColumnLabels=strrep...

más de 7 años hace | 0

| aceptada

Respondida
Replace categorical value with numeric values
If categorical variable is c, then d=double(c)-1; presuming didn't define them except by default which will be in alphanumeric...

más de 7 años hace | 0

Respondida
i need to compare a matrix with a static table
> [interp1(Y(:,1),Y(:,2),X(:,1)) interp1(Z(:,1),Z(:,2),X(:,2)) interp1(A(:,1),A(:,2),X(:,3))] ans = 279.6900 255.4500 247....

más de 7 años hace | 0

| aceptada

Respondida
msgbox is not displaying the string entered in body
Should be msgbox('Message','Title')

más de 7 años hace | 0

Respondida
Generate beta random number without statistics toolbox
Given Ui are uniform random variates Y1=U1/α1 and Y2=U1/β1, such that Y1+Y2<=1, then X=Y1/(Y1+Y2) follows the beta dist...

más de 7 años hace | 0

Respondida
how to fit a a curve using gamma fit
See doc gamfit but all the inflection points in the green curve have no chance to be reflected in a fitted function.

más de 7 años hace | 0

Respondida
Randomly assign a value to each column of a matrix
Not way subscript expansion works as written...use seqS(sub2ind(size(seqS),[1:mt].',t)) = true; instead

más de 7 años hace | 0

| aceptada

Respondida
Accessing Character Vectors Within Cell Arrays, Output Is Size of Character Vector, not Contents?
While not your specific question, couldn't help but recast your function using standard MATLAB functions for various operations ...

más de 7 años hace | 0

Respondida
Moving mean in matrix
% Identify the columns that contain at least one 999999 isKey = matriz_media == key; colIdx = find(any(isKey,1)); ...

más de 7 años hace | 0

Respondida
how do you get the max y value in an fplot?
Look at the documentation and see what else you can do with fplot... fp=fplot(mu,[0 100]); [mxMu,imx]=max(fp.YData); % ...

más de 7 años hace | 0

Respondida
3D plotting help
Per the documentation for scatter3, scatter3(X,Y,Z,S,C) draws each circle with the color specified by C. If C is a RGB triple...

más de 7 años hace | 0

| aceptada

Respondida
Renaming batch names removing extensions
Job for command. Make a .cmd batch file from the following--name DORENAME.CMD or somesuch... echo off setlocal for %f in (18...

más de 7 años hace | 0

| aceptada

Respondida
Plotting fresh plot for every iteration and change x-direction
Some basic "issues"... Your figure line is figure(6) which always reverts to the same figure you requested so it's not surprisi...

más de 7 años hace | 1

| aceptada

Respondida
How can I modify appearence of multiple plots?
Save the errorbar object returned handles and set properties as desired.

más de 7 años hace | 1

| aceptada

Respondida
Convert 1x2 double to 1x1 string
>> string(sprintf('[%d,%d]',s)) ans = "[3,7]" >> or, with features built into the new string class that mimic VB in ma...

más de 7 años hace | 1

| aceptada

Respondida
How do I change datetime format in stackedplot on X-Axis?
hAx=gca; hAx.TickLabelFormat='hh:mm:ss'; You can set the XTick values as wanted but there will not possibly be room to label m...

más de 7 años hace | 0

Respondida
How to write Multiple data to Excel
xlswrite is documented to accept one array for output...you've got two disparate pieces of data to place in the spreadsheet--you...

más de 7 años hace | 0

Respondida
Loop for extracting a matrix
nAvg=10; mnAV=reshape(mean(reshape(av,nAvg,[])),[],2); Same caveat w/ Guillaume; errors if not divisible by nAvg and the final...

más de 7 años hace | 0

Respondida
Calculate the hourly battery capacity
... B_Energy_t(i)=B_Energy_t(i-1)+delta_B_t(i); if B_Energy_t(i)>(R_B*A_B) B_Capacity_t(i)=R_B*A_B; if B_Energ...

más de 7 años hace | 1

| aceptada

Respondida
writetable with spaces on header
You will have to write the table content via fprintf then; the writetable function doesn't have the flexibility to specify alter...

más de 7 años hace | 0

Respondida
How can I plot 2 graphs with errorbar each one?
Use errorbar and hold on or as per the documentation, if y is a matrix errorbar plots a separate line for each column.

más de 7 años hace | 2

| aceptada

Respondida
how to separate strings from a datatable?
As the error message says, strsplit only operates on the strings class or char arrays--it can't handle either cell strings (the ...

más de 7 años hace | 1

Respondida
skip lines starting with a special character and assign data to variables
fid=fopen('yourfile.txt','r'); fmt='%f'; data=cell2mat(fid,fmt,'commentstyle','%')); Do the assignment to variables either by...

más de 7 años hace | 0

Respondida
how to manually calculate the stacked bar
It's hard to do with mixed signed numbers because they end up on top of each other...to see more clearly what it actually does, ...

más de 7 años hace | 0

| aceptada

Cargar más