Answered
sorting a matrix
To sort just a single row: A = [1 2 3 4 5 6 7 8 9]; % Sort only first row A(1,:) = sort(A(1,:),'descend'...

15 years ago | 0

Answered
GUIDE: Calling button press on key press
An example with _WindowKeyPressFcn_ set at the figure level. Whenever you push 'p' te action is the same pushing the button: *E...

15 years ago | 0

| accepted

Answered
how to make the regression line of lsline function colored
When you add the regression line call it like this: h = lsline; set(h(1),'color','r') set(h(2),... for more ...

15 years ago | 4

| accepted

Answered
Importing and transposing a Text file
Give a look at *Example 2* in <http://www.mathworks.com/help/techdoc/ref/textscan.html textscan>. Also: # Post the first 3-4 ...

15 years ago | 0

Answered
2D vector plot in MATLAB.
Taking the example from <http://www.mathworks.com/help/techdoc/ref/quiver.html quiver>: [X,Y] = meshgrid(-2:.2:2); Z = ...

15 years ago | 1

Answered
Handling excel file
Other than importing the entire excel as Matt suggest (which I would go for unless the number of rows selected is just a tiny pa...

15 years ago | 0

Answered
How to customize the size/font/color of characters in the command line window?
You can customize from: File > Preferences > Fonts > Custom Oleg

15 years ago | 0

Question


WindowKeyPressFcn and datacursormode on
In the following exampleGUI: <<http://i53.tinypic.com/ibm3v5.png>> If I set *datacursormode on* the WindowKeyPressFcn doesn't ...

15 years ago | 0 answers | 0

0

answers

Answered
How to find the same date when the serial datenum is slightly off
Index the result in the followin way: idx = abs(dates1 - dates2) < 1e-4 Set the tolerance on the RHS. Oleg

15 years ago | 1

| accepted

Answered
Logical mask for a concatenated series of numbers based on document length
Check this out: st = [1 101 201]; en = [45 131 226]; idx = mcolon(st, en); data(idx) You can find *<htt...

15 years ago | 1

| accepted

Question


GUI flickers when customly resized
When I select the checkbox "Show stats" the GUI is resized w/o any flicker, whereas selecting "Show buttons" causes the GUI to f...

15 years ago | 2 answers | 0

2

answers

Answered
How can I know what element a value came from in a vector?
Use the second output of <http://www.mathworks.com/help/techdoc/ref/min.html min>: [cheapest, pos] = min(cost); r(pos) ...

15 years ago | 0

Answered
Opening files with randomly varying file names
I propose a different approach: *EDIT: forgot about the wildcard* % Retrieve all the files in a directory names = dir('C:\...

15 years ago | 7

| accepted

Answered
Converting a problem from Mathematica to MATLAB
I found this article <http://galileo.phys.virginia.edu/classes/152.mf1i.spring02/RandomWalk.htm "One Dimensional RW">, and refer...

15 years ago | 0

Answered
How to rename a bunch of files in a folder
I came up with the following solution: % Directory of the files d = 'C:\Users\Oleg\Desktop\New folder\'; % Retrieve th...

15 years ago | 1

Question


How to rename a bunch of files in a folder
I was going to _merge_ .pdf files with Adobe Acrobat when I noticed they were named as 1.pdf, 2.pdf, ..., 10.pdf, ..., 20.pdf. ...

15 years ago | 5 answers | 1

5

answers

Answered
Detect Changes in Variable
Not really clear what you want to do but the loop can be simplified as: time = 1:last; consump(time) = consump(time) + t...

15 years ago | 0

Answered
Connect issue to SQL Server using x64bit Matlab
# Download ans save somewhere the <http://msdn.microsoft.com/en-us/data/aa937724.aspx Microsoft SQL Server JDBC Driver 3.0>: the...

15 years ago | 0

Answered
Execution Time
Also, you can use the <http://www.mathworks.com/help/techdoc/ref/profile.html profiler> Oleg

15 years ago | 0

Answered
Bullets in MATLAB GUIs
Are you interested in uitree and uitreenodes, then give a look at this <http://undocumentedmatlab.com/blog/uitree/ undocumented ...

15 years ago | 0

Answered
Need help With "If" statement
See <http://www.mathworks.com/help/techdoc/ref/return.html return>, place it after: display('no') Oleg

15 years ago | 0

| accepted

Answered
Saving multiple imported files
Does this solve: Spt = cell(length(files),1) for i=1:length(files) Spt(i)= {csvread(files(i).name,12,0)}; end Oleg

15 years ago | 0

| accepted

Answered
What is missing from MATLAB?
Anti-aliasing... <http://www.mathworks.com/matlabcentral/fileexchange/20979 MYAA>

15 years ago | 8

Answered
no figure toolbar
Check if you have in your <http://www.mathworks.com/help/techdoc/ref/matlabrc.html matlabrc.m> or (if it exists) in the <http://...

15 years ago | 0

Answered
Profiler Paradox
The difference is due to the JIT accelerator that kicks in when using the profiler. Same is if you save the script which calcula...

15 years ago | 1

| accepted

Answered
function call,,,,getting error
You're allowed to define a function only at the beginning of an .m file, then saving it and calling the function as _fcn(x,y)_ a...

15 years ago | 0

Answered
GUI for keyboard pressed representing the push button
A simple example which uses _KeyPressFcn_: function [] = gui() S.fh = figure('units','pixels',... 'position...

15 years ago | 1

Answered
How to use sscanf to read data file with two delimiter
I suggest the following approach: fid = fopen('C:\Users\Oleg\Desktop\trial.txt'); data = textscan(fid,'%s%s%f%f%f%f%f%f...

15 years ago | 1

Answered
Publishing in matlab
You can go this way: %% Title type('myFunc.m') %% Explanations %% Example: myFunc(1) The point here ...

15 years ago | 0

Answered
L U decomposition
Matlab is case-sensitive, if you want to store the output of _x_ then in the first line change _X_ to lowercase. Oleg

15 years ago | 1

Load more