Respondida
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...

alrededor de 15 años hace | 1

Respondida
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...

alrededor de 15 años hace | 0

Respondida
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/...

alrededor de 15 años hace | 0

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

alrededor de 15 años hace | 0

| aceptada

Respondida
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...

alrededor de 15 años hace | 0

| aceptada

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

alrededor de 15 años hace | 1

| aceptada

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

alrededor de 15 años hace | 0

| aceptada

Respondida
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...

alrededor de 15 años hace | 0

| aceptada

Respondida
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...

alrededor de 15 años hace | 1

| aceptada

Respondida
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(...

alrededor de 15 años hace | 0

Respondida
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...

alrededor de 15 años hace | 0

Respondida
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...

alrededor de 15 años hace | 1

| aceptada

Pregunta


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...

alrededor de 15 años hace | 3 respuestas | 1

3

respuestas

Respondida
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...

alrededor de 15 años hace | 2

| aceptada

Respondida
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 ...

alrededor de 15 años hace | 0

Respondida
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 ...

alrededor de 15 años hace | 0

Respondida
adding gaussian white noise to data
doc randn

alrededor de 15 años hace | 0

Respondida
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...

alrededor de 15 años hace | 0

| aceptada

Respondida
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...

alrededor de 15 años hace | 0

| aceptada

Respondida
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...

alrededor de 15 años hace | 0

| aceptada

Respondida
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 ...

alrededor de 15 años hace | 4

Respondida
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...

alrededor de 15 años hace | 1

| aceptada

Respondida
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

alrededor de 15 años hace | 1

Respondida
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...

alrededor de 15 años hace | 0

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

alrededor de 15 años hace | 0

| aceptada

Respondida
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 ...

alrededor de 15 años hace | 1

| aceptada

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

alrededor de 15 años hace | 0

Respondida
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> ...

alrededor de 15 años hace | 0

| aceptada

Respondida
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...

alrededor de 15 años hace | 0

| aceptada

Respondida
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...

alrededor de 15 años hace | 0

| aceptada

Cargar más