Is there an easy way to remove a plotted line from a set of axes without clearing everything else on the axes? I'm trying to implement a GUI with a listbox containing several data sets. I can make the callback function plot the selected data, but I'm not sure how to 'unplot' it when I deselect a data set. Any ideas?
...
I am just wondering, if I need a toolbox which not available in my MATLAB, how do I do that? For example: if I need image processing toolbox, how do I get it?
...
I'd like to zoom in on a plot using a script. I'm only interested in horizontally constrained zooming. So I'd like to do something like
p = plot(myData);
z = zoom;
set(z, 'ZoomInToPoints' , [50 100]);
or
p = plot(myData);
myZoom([50, 100]);
So either of these functions would zoom into a plot like when you zoom in with the magnif...
Is there a package in MATLAB, Maple or Mathematica which does this?
...
I am trying to take a matrix and normalize the values in each cell around the average for that column. By normalize I mean subtract the value in each cell from the mean value in that column i.e. subtract the mean for Column1 from the values in Column1...subtract mean for ColumnN from the values in ColumnN. I am looking for script in Mat...
I need this section of my code to run faster, as it is called many many times. I am new to Matlab and I feel as though there MUST be a way to do this that is not so round-about. Any help you could give on how to improve the speed of what I have or other functions to look into that would help me perform this task would be appreciated.
...
I have a simple question. How do I detect empty cells in a cell array? I know the command to eliminate the empty cell is a(1) = [], but I can't seem to get MATLAB to automatically detect which cells are empty.
Background:
I preallocated a cell array using a=cell(1,53).
Then I used if exist(filename(i)) and textscan to check for a fil...
I am essentially trying to take a matrix a and turn it into a matrix af which has the values in the first three columns of a. I just want to prune a matrix a down to only its first three columns.
...
Hi guys,
This is the following part of the below:
2) Additional question:
After getting the average of the non-zero neighbors, I also want to test if the neighbor elements are equal, lesser, or greater than the average of the nonzeros. If it is greater or equal then '1' or else '0'.
Note: if the neighbors are with in the radius of t...
I've been looking around and I can find plenty of tutorials and videos, but I find that the best way to learn something is by working through practise problems. Even better when there are solutions.
Something like projecteuler.net is good, but I need something which is more specific to MATLAB and will allow me to master all the basics o...
how can i simulate a ma(1) model with parameter =0.7 using matlab
...
Hi guys,
I'm trying to write an .m file to extract energy features from an audio track but I seem to be having trouble in its implementation:
% Formula for calculating RMS
[f, fs, nb] = wavread('Three.wav');
frameWidth=441; %10ms
numSamples=length(x);
numFrames=(numSamples/1);
energy(frame)=0;
for frame=1:numFrames,
startSample=...
Suppose I have D, an X-by-Y-by-Z data matrix. I also have M, an X-by-Y "masking" matrix. My goal is to set the elements (Xi,Yi,:) in D to NaN when (Xi,Yi) in M is false.
Is there any way to avoid doing this in a loop? I tried using ind2sub, but that fails:
M = logical(round(rand(3,3))); % mask
D = randn(3,3,2); % data
% try getting x,...
How to exit a matlab m-file (NOT the matlab itself) if the user enters bad inputs?
I know if a m-file goes wrong at run time we can press Ctrl-C to stop it. but I need a command to put it in my m-file to do so if something bad happens.
Please don't suggest 'exit' or 'quit' commands as they terminate the whole matlab and I don't want it...
Hi friends
I looking for hybrid algorithms in energy efficiency for wireless lan. I look an example of this code in c ,cpp, matlab or any other language that I can easily use it.
I already write RSA and ECC algoritm ,but I dont have any idea about how to implement hybrid algoritm,would you help me in this problem?
RSA = Rivest Shamir ...
I wrote the following function
% e is n×1 and y is n×1 vectors
function z=e_rand(e,y)
b_LS=regress(e,y)
z=b_LS*5
I saved the function in MATLAB toolbox.
But when I run the function I get the following error:
input argument "e" is undefined
How can I create the function correctly?
...
Hi,
I have a large tab delimited file (10000 rows, 15000 columns) and would like to import it into Matlab.
I've tried to import it using textscan function the following way:
function [C_text, C_data] = ReadDataFile(filename, header, attributesCount, delimiter,
attributeFormats, attributeFormatCount)
AttributeTypes = SetAttributeType...
I am trying to create a 2D map of some place. I get a 181x1 vector of laser sensor readings from a robot. All the values in this vector corresponds to a distance from that single angle like 1°,2°..180°. The problem here is I need to create a map by plotting these distances as dots with plot() or a similar function to it.
...
Hi,
I have a text file of 10001 lines, where first line contains the name of the attributes and the following lines contain values. The attribute types are mixed (strings and floats) and delimited by '\t'.
Does anyone know what is the best way to import such text file into matlab and organize these data into appropriate structure for f...
Yesterday I finalised the code for detecting the audio energy of a track displayed over time, which I will eventually use as part of my audio thumbnailing project.
However I would also like a method that can detect the pitch of a track displayed over time, so I have 2 options from which to base my research upon.
[y, fs, nb] = wavread('...