Answered
Data extraction from .txt file
isMonday = ( weekday( datenum( vec ) ) == 2 ); % every monday However, bank holidays is a problem. As far as I know M...

14 years ago | 0

Answered
Data extraction from .txt file
Check whether this approach is fast enough. SSCANF used to be faster than DATEVEC to convert date strings with identical format ...

14 years ago | 1

| accepted

Answered
Deleting rows with specific index
Try Matrix( [6 13 16 25 30 86], : ) = []; and learn how to use the Matlab documentation

14 years ago | 3

Answered
Understanding object deletion for user defined classes
The design goal of The Mathworks is that we, the users, should not need to bother about memory management - I believe. There ...

14 years ago | 3

| accepted

Answered
How to get exact position of text with respect to figure row, column in Matlab
The parent of an text-object is an axes-object. The extent of the text-object is relative to the axes-object. Use pixels for all...

14 years ago | 0

Answered
Working with global variables is fast?
Read <http://blogs.mathworks.com/loren/2007/03/22/in-place-operations-on-data/ Lorens blog> on in-place functions Check the F...

14 years ago | 1

Answered
Import Data using function
Why not use the wizard and just ignore or delete textdata? Here is an alternative to textread. Doc says: "textread will be r...

14 years ago | 0

Solved


Swap the input arguments
Write a two-input, two-output function that swaps its two input arguments. For example: [q,r] = swap(5,10) returns q = ...

14 years ago

Answered
try to manage a dynamic list of classinstances
Try %% man = manlists; man.nodelist(end+1) = node(1,2); %% man = man.AddNode(1,2); man.grN with th...

14 years ago | 0

Solved


How to find the position of an element in a vector without using the find function
Write a function posX=findPosition(x,y) where x is a vector and y is the number that you are searching for. Examples: fin...

14 years ago

Solved


Find all elements less than 0 or greater than 10 and replace them with NaN
Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN. Example: Input ...

14 years ago

Solved


Is my wife right?
Regardless of input, output the string 'yes'.

14 years ago

Solved


Add two numbers
Given a and b, return the sum a+b in c.

14 years ago

Answered
how to transform a time-serie data non uniform to uniform
Try this day = [1 2 4 6 7 8 10 11 14 15 16 19 20 21 22 23 24 25 26 27 28 29 30]; y = rand( 1, numel(day) ); day_uni...

14 years ago | 0

| accepted

Answered
Cannot call function
I never use inline, because I believe that anonymous functions are a better alternative %% a = [-1 0 1 2 3]; b = 2*a...

14 years ago | 1

Answered
how to extract elements along specified dimension of array
A(ixi,ixj,ixk) where ixi,ixj,and ixk are numerical vectors (/scalar) of integers. ":" would correspond to (1:number_of_elem...

14 years ago | 0

Answered
Get information of property type of object properties (i.e. 'dependent')
With R2010b helps says: When comparing handle objects, use eq or the == operator to test whether objects are the same handle....

14 years ago | 0

Answered
assigning a vector to struct array filedname
I guess this does what you ask for. [objects.x] = deal_num( [X.x] ) function varargout = deal_num( vec ) ...

14 years ago | 0

Answered
gathering data corresponding to a string of dates
Logical indexing is the key I would say: data = 1 + (20-1).*rand(8760,1); time = datenum( StartDate ) + (0:8760-1)/24;...

14 years ago | 0

| accepted

Answered
geting started with oop
Firstly, you need to be more careful with the names. Should it be Knot or Knoten and Slab or Stab. Secondly, the constructor ...

14 years ago | 0

| accepted

Answered
Using Timer and Classes
The problem is that it is a value class and that you don't keep the updated object. classdef Updates < handle makes it ...

14 years ago | 0

Answered
Column/multi selection mode
*No*, but I agree it would be useful! Every other day I copy blocks of code to Notepad++ to use "vertical selection" and reg...

14 years ago | 11

Answered
Automatic tool to generate Sequence and Class Diagrams (UML)
2010-03-07: I replaced the diagram. (S) stands for Singleton. ================ I incude a Class Diagram that I just genera...

14 years ago | 0

Answered
Delete multiple rows from array
Two possible approaches are: array( v3==0, : ) = []; and for ii = size( array, 1 ) : -1 : 1 if v3{ii}==0 ...

14 years ago | 2

| accepted

Answered
Find function (dependence)
Search for "Basic fitting" in the on-line help!

14 years ago | 0

Answered
Automatic tool to generate Sequence and Class Diagrams (UML)
I've done some experiments with PlantUML+Graphviz. My Matlab tool automatically generates PlantUML-code based on the m-files. Th...

14 years ago | 0

Question


Is it possible to control code folding with code?
There is a public <http://blogs.mathworks.com/desktop/2011/05/09/r2011a-matlab-editor-api/ MATLAB Editor API>. However, I cannot...

14 years ago | 1 answer | 2

1

answer

Solved


Times 2 - START HERE
Try out this test problem first. Given the variable x as your input, multiply it by two and put the result in y. Examples:...

14 years ago

Solved


Column Removal
Remove the nth column from input matrix A and return the resulting matrix in output B. So if A = [1 2 3; 4 5 6]; and ...

14 years ago

Solved


Determine if input is odd
Given the input n, return true if n is odd or false if n is even.

14 years ago

Load more