Answered
??? Matrix index is out of range for deletion...
Trivial example implemented two ways-- a) your case (from beginning)... X=rand(10,1); for i=1:length(X) if(X(i)<...

12 years ago | 5

| accepted

Answered
??? Matrix index is out of range for deletion...
for k=1:size(finalLinkCost1DMatrix,3) for f=1:6 if path(f,8,k)~=0 path1(:,:,k)=[]; finalLinkCost...

12 years ago | 1

Answered
I am getting an 'Unable to open file.' error with importdata?
If the file name is correct and not misspelled and in the location you think it is, there's no reason Matlab can't open it, rega...

12 years ago | 1

Answered
Plug in matrix values into a Formula
>> x=1:6;u=1:2; >> [X,U]=meshgrid(x,u); % make commensurate sizes... >> f(X(:),U(:)) % evaluate vectors ans = ...

12 years ago | 2

| accepted

Answered
I am getting an 'Unable to open file.' error with importdata?
The file isn't actually named 'sample.txt' or, more likely, it's not in the current working directory or on the _matlabpath_ sea...

12 years ago | 3

| accepted

Answered
My xlsx / csv dataset is getting filled with NaNs
Starting at row 1389 you've got holes in your data -- *xlsread* fills those in as NaN by default. There are a lot more holes la...

12 years ago | 1

Answered
use plot to receive user input
a) [~,i]=min(abs(x-fun)); b) i = interp1(fun,1:length(fun),x,'nearest'); Will leave as "exercise for the student" th...

12 years ago | 1

Answered
3D Stem Plot Help - Unable to do the graph
Time=[0 0.1 2.3 4.5 9.0 10.9 nan; ... % data in uniform grid for concise representation 0 1.2 2.3 6.4 7.9 9.8 12.1; ...

12 years ago | 1

| accepted

Answered
use plot to receive user input
doc ginput % maybe?

12 years ago | 0

| accepted

Answered
How to read a single parameter value from multiple .mat files and store them in a new [n,1] (single column) array
pathname = ' ' SearchDirectory(pathname, '*Tarrays.mat'); load([pathname '\FileDirectory.mat']); for i=2:length(FileDir...

12 years ago | 0

Answered
HELP? Looping and saving
Anyway, BOB, how did you manage to create the _.csv_ files that the first column is empty? The easiest solution would be to fix...

12 years ago | 0

Answered
HELP? Looping and saving
Oh, just dawned on me... >> type bob.csv % a very short sample file I made up... ,0,7.7,11.1,-812.2 ,1,8.2,11.1,-812.5 ...

12 years ago | 0

Answered
How do I replace same values in an array?
If xy=your array; y=accumarray(xy(:,1),xy(:,2)); See doc unique doc accumarray for how the above works....

12 years ago | 0

| accepted

Answered
Financial Function Issue, Please help?
function p=Exchange(V0,U0,sigmaV,sigmaU,rho,T,r) ... _Error using Exchange (line 2) Not enough input arguments._ _E...

12 years ago | 0

Answered
How do I read all text files from a folder?
See the FAQ and there's been a "veritable plethora" of similar with much discussion on "CSV" file-reading last two weeks that is...

12 years ago | 1

Answered
Plot series with strips in the background
OK, I did take a few minutes -- I'm certainly not adroit w/ *patches* so this is crude at best--but it gets the ideas across for...

12 years ago | 0

Answered
How apply more than one "if" to determine different changes in one "matrix"
for i=1:length(base) if isfinite(base(i))<=24.2; data(i)=1.5393*base(i)-13.2; if isfinite(base(i))>=24.8...

12 years ago | 0

| accepted

Answered
Removing rows in a vector
Tutorial info -- Do NOT put blank lines in code; as you see it reverts to word wrap instead of code formatting. As previously n...

12 years ago | 1

Answered
undefined variable find, used earlier in code
Again, the tutorial info is "include the _*EXACT*_ error message including the offending line traceback info instead of paraphra...

12 years ago | 0

| accepted

Answered
Subscript indices must either be real positive integers or logicals???
l = 7; % length() is a builtin function; don't alias it... numOfWords = 1000 ; p = 0.1; %Probability of bit ...

12 years ago | 1

Answered
how to read the .c file contents from the browsed files by matlab code..?
folder_name = uigetdir('','source_code'); c=dir(fullfile(folder_name,'*_data.c')); % return directory list of matching fil...

12 years ago | 2

Answered
Pass elements to a different cell array given a specific condition
>> a={'ABC' '970508';'FED' '970524';'BAC' '970601';'IGH' '970606'}; >> b={'IGH' 'FINANCE BANK1';'FED' 'HEALTH PILLS';'ABC' 'F...

12 years ago | 0

Answered
Change type of a structure field
Does this help? >> data{1}={'this is stuff'}; >> data{2}='word' data = {1x1 cell} 'word' >> iscell(data{2}) ...

12 years ago | 1

| accepted

Answered
Remove elements from an array
XX=YY(k,:); I pointed you to this earlier I believe -- look up "logical addressing" in the documentation; it's _still_ a ...

12 years ago | 1

Answered
Will not plot on force trace
If the variables _to_ and _td_ are the _*indices*_ for the time values desired in the overall _time_ vector, it would appear tha...

12 years ago | 0

| accepted

Answered
Error when importing with csvread
Franchesca-- _Please_ format your code more cleanly -- eliminate all the blank lines or use a % comment if think blank line i...

12 years ago | 0

Answered
Query regarding data input from excel data sheet
Don't need to "eliminate" anything, just select the column(s) wanted as input arguments. For an array X of 5 (say) columns of...

12 years ago | 1

| accepted

Answered
How can i choose the folder from the files in system by using matlab code..?
doc uigetdir doc uigetfile % and friends help uitools to see the builtin Matlab user interface stuff and select a...

12 years ago | 0

| accepted

Answered
Data labels above bars on grouped bar plot
You're on the right track, the center of each group is at the axis tick value. For each bar in the group, use that value plus/m...

12 years ago | 3

| accepted

Answered
Error using vertcat Dimensions of matrices being concatenated are not consistent.
You're trying to write the equivalent of Z = [1 2 4; ... 3 ; ... 8 ; ... 9 ; ... 8...

12 years ago | 0

| accepted

Load more