Answered
Delete rows from a cell given a specific condition - Matlab
Working just with the alpha column, >> c={'ABDR';'ABDR';'ABDR';'ABDR';'ABDR';'ABD';'ABD';'ABFI'}; >> [u,~,i2]=unique(c); ...

12 years ago | 1

| accepted

Answered
Error in loop: Attempted to access X(5); index out of bounds because numel(X)=4
Yes, a very common error in coding logic everybody makes when starting out...when you process from the beginning and remove a ro...

12 years ago | 0

| accepted

Answered
Select specific elements in a cell
Instead of reading the file line-by-line and "growing" the arrays incrementally, try something like x=textread('filename');...

12 years ago | 1

| accepted

Answered
Arranging Data based on relationship different columns
X=sort([A B C],2,'ascend');

12 years ago | 0

Answered
How do I separate data into columns from a text file?
Problem is there's no separation between the two column headers so *readtable* thinks there's to be only one variable. Either f...

12 years ago | 1

Answered
Fast and easy axis break
plot(x(31:60)(y(31:60)>=160),y(31:60)(y(31:60)>=160),'.'); becomes i1=31; i2=60; % the ranges for the cas...

12 years ago | 1

Answered
How can I Plot continuation plot?
If all you want is the plot, no need to concatenate, simply keep the cumulative length as you go and continue on the plotting po...

12 years ago | 1

Answered
while loop with if-statements to set criteria for data.
i=0; while ~feof(fid) strLine = fgetl(fid); numLine = str2num(strLine); if numel(numLine)>1 && min(numLine...

12 years ago | 1

| accepted

Answered
pass big matrices into function
function outputs=yourfunction(B,C,D,E,G) % do whatever to compute outputs with the input arrays Matlab syntax doesn't ...

12 years ago | 1

Answered
How to debug the" illegal statement termination" ?
>> make Error atoi.cpp: 20 illegal statement termination Error atoi.cpp: 20 skipping `int' Error atoi.cpp: 20 undeclar...

12 years ago | 0

Answered
Colour mismatch between plot and legend
See if this thread helps-- <http://www.mathworks.com/matlabcentral/answers/137221-change-bar-graph-legend-color> Parti...

12 years ago | 1

| accepted

Answered
Ploting data with tolerance
doc errorbar

12 years ago | 1

Answered
Basic ploting and labeling
The questions are answered in the "Getting Started" sections of the documentation on array and cell array addressing...need to j...

12 years ago | 1

| accepted

Answered
Datenum not failiing as expected
Build a verification function before passing to *datenum* -- something on the order of >> ds={'20140630-12022';'201406-1202...

12 years ago | 1

Answered
Deleting columns in matrix based on specific looping
If Ntot is only 18x18, how are you going to remove 8*18 (=144) columns? Something is inconsistent in your description. Assum...

12 years ago | 2

| accepted

Answered
can someone explain to me what this code means??
2/L*abs(Y(1:NFFT/2+1))) gives a one-sided (DC to Nyquist) amplitude spectrum. The above is the two-sided version from [-N...

12 years ago | 1

| accepted

Answered
using while-end block to find pattern in an array
Putting comments together since did put in the effort to try... L=length(pattern); % keep the constant i1=1;i2=L; ...

12 years ago | 1

Answered
How to make a loop to find average of each month
mndata=zeros(12,2); % preallocate for m=1:12 % over each month mndata(m,:)=mean(vinddata_mean_month...

12 years ago | 1

| accepted

Answered
Matlab GUI: Showing data from COM port in listbox without using any push button
Because there is no event for the listbox w/o a user intervention -- so the callback function will never be called. You need ...

12 years ago | 1

| accepted

Answered
How to capture the names or indexes in a variable using gname?
The floating point numbers are handles to the plot text objects...to find out which is which, cats = get(mycluster,{'string...

12 years ago | 0

Answered
how to avoid the error "matrix dimensions must agree" when i try to save the image?
Error in manual>savefinal_Callback (line354)if im2==grayimage The problem is you're trying to compare what looks to be a gl...

12 years ago | 2

| accepted

Answered
Extract numbers between two underscores.
>> s='Color_84_2014-01-31-16-49-31-702.jpg'; >> sscanf(s,'Color_%d_%d-%d-%d-%d-%d-%d-%d.jpg') ans = 84 2...

12 years ago | 2

Answered
How do you calculate percentage change between sequential elements in array?
pct=100*diff(a(:,1))./a(1:end-1,1);

12 years ago | 1

Answered
Help in writing a function file where the user defines a linear function
_...how do I plug my xl and xu into a user defined function in a loop?_ All depends on how you want it to behave -- generally...

12 years ago | 2

| accepted

Answered
how to use "save" matlab
for i=1:size(res_tAcc.data,1) fprintf(fid, '%f ', res_tAcc.time(i,1)); fprintf(fid, '%f %f %f %f %f %f %f %f %f %f ...

12 years ago | 2

| accepted

Answered
how to add errorbars
_...scales the matrix to put the errorbars in the middle of the plotted bars, and I have no idea how MATLAB determines where it ...

12 years ago | 1

Answered
A grouping vector numbers
I can't really parse the request but on an off chance it'll help... BTW, the shortcut for reshape(x,1,[]) is v=A(:); % ...

12 years ago | 0

Answered
Probelm importing csv file with csvread
_(row 1u, field 77u) ==> nity,,0.0,0.0,3.33...42E-4,,50.0,0.0,...0.0,Infinity,,\n_ The recognized value is 'Inf', not 'Infini...

12 years ago | 0

Answered
Cant create a function that return array correctly
function z =advancex(n,Imax,x) for i = 1:Imax z(n+1,i) = x-0.5; _...only z(Nmax,:) is correctly calculated._ ...

12 years ago | 1

| accepted

Answered
Counter Values Are Not Changing, MATLAB
_...the value of size(res_t,1) = 1 , that's why i doesnt do the loop. res_t is a matrix having 9 lines_ Well, one or the othe...

12 years ago | 0

Load more