Answered
to find variables in a string
See FEX contribution: <http://www.mathworks.se/matlabcentral/fileexchange/32769-mparser mparser>

14 years ago | 1

Answered
Creating Edit Box without using GUIDE
This is a start fh = figure; ebh = uicontrol( fh, 'Style', 'edit' ) next step is doc uicontrol . ...

14 years ago | 0

| accepted

Answered
Extract n lines from a text file
Something like this might work fid = fopen( 'cssm.txt', 'r' ); str = permute( fread( fid, '*char' ), [2,1] ); ...

14 years ago | 0

Answered
Extract the upper and the lower half of an integer
See: bitget C = bitget(A, bit) returns the value of the bit at position bit in A.

14 years ago | 0

Answered
cooling_load.m
Google for "EnergyPlus building"

14 years ago | 0

Answered
How to import a very large nucleotide sequence in Matlab workspace
4772342 bytes is a small file Matlab should not exit, but issue an "Out of memory error". If Matlab exits there is some other...

14 years ago | 0

Answered
use part of file name
sad = dir('AAA*.dat'); name_list = { sad.name }; captures the file names cac = regexp( name_list, 'AAA_(\d+)_...

14 years ago | 0

Answered
Clearing handle subclasses with timer objects
My mental model says that "@(a,b)" contains a snapshot of the scope in which it was created. That snapshot includes "this". Thus...

14 years ago | 1

| accepted

Answered
Working with structures
??? >> s.p = [32 35; 36 37 39] Error using vertcat CAT arguments dimensions are not consistent.

14 years ago | 0

Answered
MATLAB plotting question.
"2sin(t)" should read "2*sin(t)"

14 years ago | 0

| accepted

Answered
time delay
See: *timer* Construct timer object.

14 years ago | 0

Answered
rejection method
Firstly, it would probably be more efficient to use a .<nx2> matrix. Matlab is column oriented. Try M( :, M(:,1)==0 ...

14 years ago | 0

Solved


Back to basics 15 - Benchmark
Covering some basic topics I haven't seen elsewhere on Cody. Return an array of the benchmark values for MATLAB.

14 years ago

Solved


Multiply a column by a row
* Given a column vector C and and a row vector R. * Output a matrix M. * Every column of M equals to C multiplied by correspon...

14 years ago

Answered
pop up in address_book GUI demo with .mat file
See GUI 28 and 33 in the FEX contribution <http://www.mathworks.se/matlabcentral/fileexchange/24861-41-complete-gui-examples 41 ...

14 years ago | 0

Answered
Closing all figures, but not GUI
There is no simple way to do that in Matlab. In the FEX there are some contribution, which try to provide help, e.g. <http:/...

14 years ago | 1

Solved


Vectorize the digits of an Integer
Create a vector of length N for an integer of N digits. x=123045; x_vec=[1 2 3 0 4 5]; I happened upon a trick to do ...

14 years ago

Solved


Find number of days
The input is two date in string format (dd-mm-yyyy) find out the number of days between these two dates. Example: input: ...

14 years ago

Solved


Replace Vector Elements
Replace all elements in a vector which are equal to or smaller than zero with 0.1. Example: A = [1 2 3 -1 0 2 -3 -80]; ...

14 years ago

Answered
Efficient matrix comparisons that retain row/column order
This would be my first trial: mat3 = mat1; mat3( diff >= 0.2 ) = 0; This isn't magic it is logical indexing!

14 years ago | 0

| accepted

Answered
explaining the output of datevec
datevec interprets a double as a serial date number. numdays = -1071 says that the first date is 1071 days before the latter...

14 years ago | 0

Answered
Indexing structured arrays
Have you tried new_struct = cat( Struct1(i:i+n), Struct2(k:k+n) ); Are the fields in the same order? Try this ...

14 years ago | 0

| accepted

Answered
doubt regarding textscan
What do you mean by "no result"? What value does fid have? This little test works fine! str = '2.6300000000000000e+002 2...

14 years ago | 0

| accepted

Question


Get available memory from Windows 7 64bits - and fast
*Background:* I run performance test on reading HDF5-files. The spread in the results are large and I cannot understand why. Now...

14 years ago | 1 answer | 0

1

answer

Solved


Return the Nth Output from an Input Command
*Description* Given _F_, a cell array whose first element is a function handle and subsequent elements are arguments, return ...

14 years ago

Solved


Remove white space from the string
Remove the white spaces (trailing and leading) from the input variable

14 years ago

Question


Order of execution of multiple onCleanup callbacks
*Background:* I'm experimenting with the file format, HDF5. In my code I open/create multiple objects, which need to be close in...

14 years ago | 1 answer | 2

1

answer

Answered
delete NaN rows and columns but
Is this close? M( all( isnan( M ), 2 ), : ) = []; % removes all rows with all nans M( :, all( isnan( M ), 1 ) ) = []...

14 years ago | 1

| accepted

Solved


Most nonzero elements in row
Given the matrix a, return the index r of the row with the most nonzero elements. Assume there will always be exactly one row th...

14 years ago

Answered
random pair data.
"not all y are use". My guess is that you want something like: y = 5 + randperm( 5, 5 ); for x = 1:5 fprintf(...

14 years ago | 0

| accepted

Load more