Answered
Why is loop time execution better than vectorized form in this case?
The gains in efficiency from vectorization are not always that substantial anymore (and can even be negative) since loops in MAT...

15 years ago | 1

Answered
Inheritance of classes inside a package
This seems to me to the documented (although maybe not expected) behavior. Quesiton 1: The documentation of calling a package...

15 years ago | 0

Answered
What does RANDPERM miss?
Peter Perkins blog on Loren's blog a while back about the random number generators. http://blogs.mathworks.com/loren/2008/11/...

15 years ago | 0

Answered
count
G = randi(3, 45, 2); I = randi(3, 45, 2); sum(all(G == I, 2))

15 years ago | 0

| accepted

Answered
for loop
If you do not have to use a for loop you can just do: I = G(:, 1:2) but if you have to use a for loop: for ii = 1:s...

15 years ago | 0

| accepted

Answered
cd work
What do you get with which -all cd It should be something like: built-in (/usr/local/matlab/r2010b/toolbox/matlab/g...

15 years ago | 1

| accepted

Answered
Difference
If I remember correctly, diff works across the first non-singleton dimension. So diff(A) works across columns and diff(A(1, :)) ...

15 years ago | 0

| accepted

Answered
PCA: number of attributes much bigger than number of data samples
This is not typically how I run PCA. I typically have many more samples than variables. I think the components returned by PCA a...

15 years ago | 0

| accepted

Answered
enforcing that a class method is called instead of an "imported" function with the same name
I haven't read the documentation on "Scoping Classes with Packages" <http://www.mathworks.com/access/helpdesk/help/techdoc/matl...

15 years ago | 1

| accepted

Answered
bucketing values
Assuming your array A is short ... A = [0.8756 0.1185 0.0059] x = rand(1e3, 1); y(x < A(1)) = 'a'; y(x >= A(1) & x < A(...

15 years ago | 0

Answered
How to reconstruct a sound with data in MATLAB?
It appears that the sampling rate is 133 Hz and the signal frequency is 1856 Hz. This means the signal will be aliased to a freq...

15 years ago | 0

Answered
editing gui text box string
Something like: for ii = 1:32 h_text = findobj(h_gui, 'Tag', ['X', num2str(ii)]); set(h_text, 'String', num2str(d...

15 years ago | 1

| accepted

Question


cell array expansion
I have just been bitten by some careless coding, but I am surprised that MATLAB lets me do it and that mlint didn't provide a wa...

15 years ago | 3 answers | 1

3

answers

Answered
Construct Timer using evalin
Creating the timer in the base workspace may make sense, if you really want the variable Timer to be there, but it is not likely...

15 years ago | 2

| accepted

Answered
How to reconstruct a sound with data in MATLAB?
It is not totally clear what you are starting with: Assuming x is your pressure waveform and is an array 2501x1 samples and the ...

15 years ago | 0

Answered
Printing Axes
Printing each subplot/axes as a separate figure is easier than printing a subset of the axes in one figure. Start with a dummy ...

15 years ago | 0

Answered
adding gaussian white noise to data
doc randn

15 years ago | 0

Answered
Call superclass method without knowing name of superclass?
It sounds like you are concerned that if you hard code the superclass name and then you change the name of the superclass you wi...

15 years ago | 0

| accepted

Answered
I am having problems getting MATLAB to start in Ubuntu
If you try and start MATLAB from a terminal window, instead of from a launcher, you might get a useful error message. You can st...

15 years ago | 0

| accepted

Answered
Programmatically calculate position for textbox (annotation)
It is a little bit of a kludge. I cannot decide if I want to include the x limits as xticks or not. Also, the char offset is rea...

15 years ago | 0

| accepted

Answered
The title of a figure
Title can take any string. You can use [] and num2str to make a meaningful string that depends on the input to your function ...

15 years ago | 4

Answered
GUI Handles?
Your two work arounds are right on. When you create the axis you want to plot into (possibly with subplot), it will return a han...

15 years ago | 1

| accepted

Answered
If I am in an UserInterface and here perform what I want; after that I want to go in another UI with all the result obtained.
See the FAQ 3F http://matlab.wikia.com/wiki/FAQ#How_can_I_share_data_between_callback_functions_in_my_GUI.3F

15 years ago | 1

Answered
add a listener to a class
If you can modify class2 and class3, then you can modify those classes to issue an event SomethingChanged, whenever a property v...

15 years ago | 0

Answered
export PSD object
Assuming you are using the newish version of psd objects ... Starting with the example from spectrum: Fs = 1000; t = ...

15 years ago | 0

| accepted

Answered
passing a cell array of objects to a method
Static methods in MATLAB do not require an object of the class, so you could pass it your cell array. I am not sure if a static ...

15 years ago | 1

| accepted

Answered
Digital filters
Introductory DSP textbooks tend to provide formula for calculating parameters for some simple IIR filters (e.g., Butterworth). T...

15 years ago | 0

Answered
Execute functions automatically
This is basically FAQ 4.6 <http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F> ...

15 years ago | 0

| accepted

Answered
how to create a program that present dichotic stimulus
I am guessing you want to do more than just present a dichotic stimulus and that there is a psychoacoustics experiment underlyin...

15 years ago | 0

| accepted

Answered
A strange problem about audio play using MATLAB (Maybe a bug in MATLAB!)
The wav file format supports arbitrary sample rates. I think the sample rates must be positive integers less than 2^32, but 1000...

15 years ago | 0

| accepted

Load more