Answered
"Index must be a positive integer or logical" error in my function to calculate velocity from acceleration
The whole approach is not optimal, but to answer your question specifically, your cannot use |k|, whose values are floating poin...

13 years ago | 2

| accepted

Answered
Finding the longest row in an array from CSVREAD
If your data is stored in array |D| and is non-zero except for the added elements, one way to obtain the length of each row is t...

13 years ago | 0

| accepted

Answered
Can you index matrices?
The following: M(5:8, 3:7) is an array that corresponds to the block defined by rows 5 to 8 of |M| and columns 3 to 7. As...

13 years ago | 0

| accepted

Answered
Matrix Sortrows by one of it Values
You should play a bit with |sortrows|, just to have a better feeling of how it works. For example >> A = [2 7 12; 1 3 10; 2 ...

13 years ago | 1

Answered
Change the function calling name instead of rename the file
_Anonymous function_ (look for them in the help, and/or for _function handles_) at the top of your test script: FCN = @(x,z)...

13 years ago | 1

| accepted

Answered
Doubt on how to simplify inputs in functions.
You can always use |varargin| function y = myFuncA(A, x, varargin) if isempty(varargin) b = 0 ; else ...

13 years ago | 0

Answered
How do I put my row vector answers into a matrix?
If the rest of the computations is correct (P, L, U have appropriate dimensions), you would do something like W(..., :) = x...

13 years ago | 1

Answered
counting occurances of a specific character in a cell array
Assuming that these are amino acids/codons (3 uppercase letters), here are three "not-very-orthodox" solutions, just for fun. Bu...

13 years ago | 1

Answered
Using switch-case. Return to beginning of switch-case statement
You don't even need |otherwise| .. isOk = false ; while ~isOk A = input ('Enter a number (0-3)'); switch A ...

13 years ago | 1

| accepted

Answered
Is it possible to set watchdogs (memory, exec time) in MATLAB?
Test script and function last edited on 01.25.2013 9:28PM EST. Here is the version above *proposed by Per Isakson*, with a fe...

13 years ago | 2

Answered
ASCII to Hexadecimal with "x" in it: example A2--> 0x410x32 (help pleas)
I would just go for a variant of: >> str = 'A2A2AA22' ; >> strhex = sprintf('0x%X', str) strhex = 0x410x320x4...

13 years ago | 0

| accepted

Answered
Discussion about Answers & Votes
I am fairly new to this forum as an active poster, but I've seen (without posting myself) quite impressive answers/comments/cont...

13 years ago | 2

Answered
conditional array extraction based on control array
For the second part of the question: z = y(c) ; What do you mean by "corresponding entries in |x| "? How do you define co...

13 years ago | 0

| accepted

Answered
How intelligently does Matlab deal with sparse matrix operations?
A sparse matrix doesn't contain its 0 elements, so internally they won't be taken into account by built-ins that support sparse ...

13 years ago | 0

| accepted

Answered
How can I find 4 or more character pattern in number array
And here is a funny solution: A = [1 2 3 2 5 12 3 9 12 3 5 6 3 2 5 12 3 9] ; % Notes p = [5 12 3 9] ; ...

13 years ago | 1

Answered
Comparing contents of structures
Not sure that I fully understand (it's late), but note that |strcmp()| and |strcmpi()| do work on cell arrays. I illustrate that...

13 years ago | 0

| accepted

Answered
replace first match with a value,second match with a different value etc
Here is a funny one-liner for you, that could be adapted to your needs: >> str = 'abc EE1 d EE1 00EE100' ; % Dummy exa...

13 years ago | 1

Answered
How to extract contents from cell array
A few other ways: >> xdata{:} or >> cellfun(@(a)disp(a), xdata) The content of cell |#3|, for example, of |xdata|...

13 years ago | 2

Question


Is it possible to set watchdogs (memory, exec time) in MATLAB?
=== *THREAD SUMMARY* ============================================================ _Please, feel free to edit this summary if ...

13 years ago | 6 answers | 6

6

answers

Answered
Deleting elements from a symbolic array
An alternative could be to work on the initial string that you pass to |sym()|. For example, if all your parameters were name...

13 years ago | 0

| accepted

Answered
How to speed up reading from N-dimensional matrix in a nested loop?
Hi Anders, Just by replacing the 8 lines defining new_grid with d3index = [c_index(ff),c_index(ff)+1] ; new_grid = cat(...

13 years ago | 0

| accepted

Answered
How to correct nt2aa to skip codons with gaps?
I don't know |nt2aa|, but I just had a fast look. Do you want to: * Modify |nt2aa| so it eliminates codons with gaps? Not sur...

13 years ago | 0

Answered
How to count numbers considering all consecutives as one??
Here is a funny way to achieve this: >> sum(diff(Data)>1)+1 *EDIT:* see my comment after Azzi's remark.

13 years ago | 0

Answered
Having regular expression stop at the first instance of a string, and not subsequent ones
>> doc regexp Under |Command options| 'once' : Return only the first match found. *EDIT* (after Walter's comment): ...

13 years ago | 1

Answered
how to covert double class to char class?
There would be num2str( [1 2 3] ) or num2str( A ) .. but what do you mean by "reduce the size of variable"? If it...

13 years ago | 2

Answered
How do you create a matrix of matrices in a method?
*Leaving aside OOP, we can say the following:* In your code, |FI| should be |BA| (the object) and you should replace |Index=z...

13 years ago | 1

| accepted

Answered
I keep on getting the error "Attempted to access y(2); index out of bounds because numel(y)=1. Error in intoff (line 11) e=y(n-1)+y(n);" some one please help.
Your error comes from the fact that you put the closing |end| of the 1st |for| loop after the second loop. Also, are you sure...

13 years ago | 0

Answered
Trouble with finding appropriate conditions for logic
Which method did you chose finally to.. * Flag facets in the shadow. * Flag facets from the shield. * Define colors. Cou...

13 years ago | 0

Answered
Steady State Probability Calculation - (Solve simultaneous eq. with 33 unknowns)
... try this ... >> doc \

13 years ago | 0

| accepted

Answered
Decompose a matrix into smaller matrices by the date
A few hints to help you start: >> C = {'01.01.2004 18:23:54', 3, 4; ... '02.01.2004 18:23:54', 2, 6; ... ...

13 years ago | 1

| accepted

Load more