Answered
For loop only running once.
This code does what I believe you want it to do x=0:9; s1 = nan(5,10); % allocate memory ii = 0; ...

14 years ago | 0

Question


Automatic tool to generate Sequence and Class Diagrams (UML)
Last month, 2020-10-03, I uploaded m2uml 2.0, which is a complete rewrite. (It generates UML class diagrams from m-code.) ...

14 years ago | 2 answers | 5

2

answers

Solved


Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...

14 years ago

Solved


Find the sum of all the numbers of the input vector
Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

14 years ago

Answered
why must rerun this code to pursue running
Make the following change to your code: f = fopen(thisfilename,'r'); to f = fopen(thisfilename,'r'); assert( ...

14 years ago | 0

Answered
scatter too slow
See: <http://www.mathworks.se/matlabcentral/answers/24076-better-way-to-visualize-profile-data better way to visualize profile d...

14 years ago | 0

Answered
Function handle of N,x to function of x
Try this: x = 16; K = @(N) x/N; K(2) If that is not what you asked for please rephrase your question.

14 years ago | 0

Answered
Converting hh:mm:ss into seconds
The first and the last cell returns the result I think you are looking for. See help on DATENUM %% datenum( '14:35:59.8...

14 years ago | 2

Answered
is there anyway to select which cell modes to run?
Yes, see <http://www.mathworks.se/help/techdoc/matlab_env/brqxeeu-259.html Evaluate Subsections of Files Using Code Cells>

14 years ago | 0

Answered
find a coordinate on a cdf plot
My guess: [f,x] = ecdf(a); x(1) = x(1)-eps(x(1)); interp1( f, x, 0.5 ) interp1( x, f, 100 )

14 years ago | 0

| accepted

Answered
cell array of classes
R2010b doc says: *Building Arrays in the Constructor* A constructor function can return an object array by making the ne...

14 years ago | 1

| accepted

Answered
Dynamic Structure Fieldnames using Genvarname() Invalid
The variable, testname, is a cell array of cells. Your code assumes it to be a cell array of strings K>> class( testname{1...

14 years ago | 2

| accepted

Answered
reading txt file mixed with stirng and numbers
Are you aware of the FEX contributions: <http://www.mathworks.com/matlabcentral/fileexchange/15629 ENVI file reader, updated> an...

14 years ago | 0

Answered
How to address dataset array column using variable
Try DS.('C1')

14 years ago | 0

| accepted

Answered
better way to visualize profile data
Matlab cannot handle that many handle graphic objects efficiently. SCATTER creates one handle for each point. The following chan...

14 years ago | 0

Answered
representing and empty cell
Does this help? %% wordstruct.a = {'amal' 'asyik' 'ampun'}; wordstruct.b = {'bola' 'busuk' 'basi'}; wordstruct...

14 years ago | 0

| accepted

Answered
saving workin space variable
Doc says: save(filename, variables) try save('myfile.mat', 'myvar' )

14 years ago | 0

| accepted

Answered
Variable superclass
One way that I have used is to write an m-file at run time. classdef C < Middle ... At run time I write the file, Middle...

14 years ago | 0

Answered
isletter true false
isletter is a function, which returns a logical value. The logical values, true and false, are displayed as 1 and 0, respectivel...

15 years ago | 0

| accepted

Answered
MYSQL database table from MATLAB
See <http://www.mathworks.se/matlabcentral/answers/5285-mysql-matlab mysql-matlab> for a good alternative to the toolbox.

15 years ago | 0

Answered
Open Separate Matlab window to run in background
See the answer: <http://www.mathworks.se/matlabcentral/answers/15800-is-it-a-good-idea-to-run-matlab-in-the-background-as-a...

15 years ago | 0

Answered
How can I read data column by column from an ASCII file ?
See the answer: <http://www.mathworks.se/matlabcentral/answers/15712-textread-formatting-help textread formatting help>

15 years ago | 0

Answered
textread formatting help
Do you know the exact format, i.e. the length of each field? I assume you do! Read the full line as a string buf = textscan(...

15 years ago | 0

| accepted

Answered
Transparency in 2D scatter plots
I think it is doable with some low level handle graphic code. Each point should be a separate patch object (or a surface object)...

15 years ago | 1

| accepted

Answered
object oriented programming in 2007b
There are two Matlab OOP. The old one and the new, which appeared in release R2008a. The difference between the two is huge. ...

15 years ago | 0

| accepted

Answered
large files, very slow editor, no fix?
An object oriented design with methods in a separate @-folder should solve the problem with the editor. Rewriting object ori...

15 years ago | 0

Answered
Exporting a GUI to be used without MATLAB
AFAIK, you will need the Matlab Compiler. See www.mathworks.com MATLAB® Compiler™ compiles a MATLAB® application into a stand...

15 years ago | 0

Answered
writing a string
I prefer sprintf( 'Panel A: range(%u-%u)', A, B ) because I make fewer mistakes using that style - per

15 years ago | 0

Answered
Is it possible to extend graphics objects' functionality through inheritance?
There is no documented way to inherit from (/subclass) handle graphic objects. I guess the rule is that if you cannot find it in...

15 years ago | 0

Answered
piecewise fitting with user defined functions
See * SLM - Shape Language Modeling by John D'Errico * BrokenStickRegression by Peter Nave In the File Exchange / ...

15 years ago | 0

Load more