Answered
Why is indexing vectors/matrices in MATLAB very inefficient?
The fact that different means of indexing take different amount of time is interesting, but probably not that useful to understa...

13 years ago | 0

Answered
Problems with matrix dividing
I have no idea what you are trying to do ... Do you want to do element wise operations? There is a difference between ^ and ....

13 years ago | 0

Answered
Why is indexing vectors/matrices in MATLAB very inefficient?
MATLAB is not as simple as you suggest. You were looking for the extra read and write overhead you observe with |x(1:end)| and |...

13 years ago | 1

Answered
change axis of a plot
There are a number of good <http://peltiertech.com/WordPress/broken-y-axis-in-excel-chart/ reasons> to avoid these breaks, and o...

13 years ago | 0

| accepted

Answered
Randi with string variables
Is this what you want? items = {'lapin', 'souris', 'voiture', 'saumon', 'vĂˆlo', 'table', 'cochon'}; items(randi(length(i...

13 years ago | 1

Answered
When plotting, how do I change properties associated with the X-axis?
I am not sure what all the parameters are that you are passing to boxplot. Does this do what you want? h = boxplot(ABC, 'la...

13 years ago | 0

Answered
Sorting variable names in alphabetical order
Assuming you mean the variable editor and not the workspace window, I think this is a possible bug. There seems to me no good re...

13 years ago | 1

Question


Floating point accurarcy and COLON
I have just been bitten by an odd floating point comparison issue. At the heart of the issue is that I expected to get true for ...

13 years ago | 1 answer | 4

1

answer

Answered
Not enough input arguments error
The error is not in quantizer function, but rather in how you are calling it. In line 6 of whatever function you are calling is ...

13 years ago | 0

Answered
reshape with a huge matrix
I am not sure what you mean by your notation. Is this what you are looking for? n = 10; x = repmat(1:(118*9), 1, n); ...

13 years ago | 1

Answered
Spaces for readability in code
I recently found out that <http://www.mathworks.com/matlabcentral/answers/48645-syntax-bug-r2011a-x-y spacing> can matter. I gen...

13 years ago | 1

Answered
Is it possible to disable the debugger?
Jan has provided some links to CSSM threads about p code security <http://www.mathworks.com/matlabcentral/answers/9848#comment_2...

13 years ago | 0

Answered
randn not random in parfor loops
You are correct and this is a good thing and consistent with the idea that MATLAB uses the same "seed" every time it starts. Pet...

13 years ago | 1

Answered
A-weighting Sound Filter
Your example code is for a single period of a sine wave. The filter you design, however, rings for a period of time. You want to...

13 years ago | 0

Answered
working with an array pointer in a recursive function
If you want to return "void" you simply do not return anything ... function ConstrucQuadtree( A,n,QuadtreeArray,index ) ...

13 years ago | 0

| accepted

Answered
close a message box thru coding
You could do something like h = msgbox('please wait'); n = 0; while rand > 1e-9; n = n+1; end; delete(h); Where...

13 years ago | 2

| accepted

Answered
What is the difference of using ; after end?
I often add a semicolon or comma after statements like "end" where they are not strictly useful so that I can easily create sing...

13 years ago | 1

Answered
What causes variable editor to be blank for OOP (openvar)
This has come up a number of times on Answers. I am pretty sure the variable editor cannot handle custom classes. I would start ...

13 years ago | 0

Answered
Is there a shorter/smarter way to do this code
It depends what you mean by better. To me the best code is the the code that is easiest for me to maintain unless it is a time b...

13 years ago | 0

Answered
how do I dynamically change variable name for dataset array?
See <http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F FAQ: 3F>

13 years ago | 0

Answered
Suppress line number display in error message
I will try this as a new answer. Just wrap everything (or almost everything) in a try-catch... function varargout = reader(...

13 years ago | 0

Answered
Cell-Preallocation slows down code
Preallocating a cell array is of limited benefit since it only contains pointers to the memory locations of the elements. I thin...

13 years ago | 1

| accepted

Answered
Test existence of files with EXIST
I am not sure you are using EXIST how it was intended to be used. The H1 line is: _%EXIST Check if variables or functions are d...

13 years ago | 0

Answered
Suppress line number display in error message
In your exact use case, where you only supply an error message and no identifier, I don't think you can. If you are willing to p...

13 years ago | 0

Answered
Why do deep paths in \usepackage cause texmex to crash (segmentation violation)?
I can recreate your problem on R2011a Linux. I modified your MWE to be texpath{end+1} = 'C:/stys/two/three/four/five/six/se...

13 years ago | 0

| accepted

Answered
installation problems matlab and simulink student version R2011a
Are you running 64-bit Linux? the student version only supports 32-bit linux. There are a number of questions here about trying ...

13 years ago | 0

Answered
Sound output latency issue
You are not giving us much to work on ... The rate at which soundcard hardware can be rapidly and repeatedly triggered depend...

13 years ago | 0

Answered
Why 'str2double' is preferred over 'str2num?
In this case I think it is best to actually look at the code of the two functions type str2num type str2double One pr...

13 years ago | 8

Answered
systematic: Do not use global, don't use eval
There are certain things that cannot be done without EVAL (or meta programming). In general, these are hacky type things. For ex...

13 years ago | 3

Answered
re-formatting a matrix
First lets create some dummy data. I am intentionally creating it in a non-optimal manner depth = [0:1:20]'; data1 = ran...

13 years ago | 0

Load more