Beantwortet
Analyse and make pattern from csv file
You will have to define a little better what you want to extract when errors are logged, but here is an example using REGEXP: ...

mehr als 13 Jahre vor | 0

Beantwortet
Multiplying matrices as cells - 4 dimensional with variable no. of matrices (code works now!)
As you have only a limited number of values for |f|, you should avoid using complicated 3D or 4D arrays (indexing them is not al...

mehr als 13 Jahre vor | 0

| akzeptiert

Beantwortet
Data Saving - Storage Efficiency
>> f_dbl = 1 ; >> f_log = true ; >> whos Name Size Bytes Class Attributes f_dbl 1x1 ...

mehr als 13 Jahre vor | 0

Gelöst


Return the 3n+1 sequence for n
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

mehr als 13 Jahre vor

Beantwortet
More Efficient Assignment Operation - Sparse Matrix
See: <http://www.mathworks.com/matlabcentral/answers/69528-sparse-matrix-more-efficient-assignment-operation>

mehr als 13 Jahre vor | 1

Beantwortet
Not sure what I'm doing wrong. FOR LOOP
Difficult to know without seeing your sequence, but imagine that the cell array |codons| contains 60 characters.. when t = 60, a...

mehr als 13 Jahre vor | 0

Beantwortet
Sparse Matrix - More Efficient Assignment Operation
The structure of sparse matrices in memory makes this kind of indexing operations slower than building the sparse matrix directl...

mehr als 13 Jahre vor | 2

Beantwortet
How many times does each number appear?
Hi Hamad, Well, how large is "extremely large"? Image Analyst might have given you the optimal solution already. As an altern...

mehr als 13 Jahre vor | 2

Beantwortet
Form strings/numbers from matrix
If you want numbers: >> A = [1 2 0; 0 2 6; 9 8 0; 0 0 2] A = 1 2 0 0 2 6 9 8 0 ...

mehr als 13 Jahre vor | 1

| akzeptiert

Beantwortet
create n arrays in matlab
If you really want to build |n| separate arrays, you will have to store them in a cell array, unless you want to dynamically gen...

mehr als 13 Jahre vor | 1

Beantwortet
Is there a clean way to find the number of elements in a vector that are "near" a specified constant?
Yes, you can proceed as follows: >> n = sum(abs(A-100) < 5) n = 8

mehr als 13 Jahre vor | 0

| akzeptiert

Beantwortet
how do i create a recursive function that gives the number of digits in an integer? i.e. does the same that length function does in MATLAB
As Wayne mentioned, recursivity in unnecessary, but if you had to implement a recursive function, you could have built something...

mehr als 13 Jahre vor | 1

| akzeptiert

Beantwortet
read a number after a specific string in a txt file
As it's a bit more elaborate than your previous question, it might be time to go for a regexp solution (even though you can alwa...

mehr als 13 Jahre vor | 3

| akzeptiert

Beantwortet
Faster Method for removing duplicates
>> node_u = unique(node, 'rows', 'stable') node_u = 0.1234 5.6789 3.4567 9.8765 4.5678 8.7654 shou...

mehr als 13 Jahre vor | 1

| akzeptiert

Beantwortet
compute the repetition of a string in a text file
Your best option for pattern matching is usually regular expressions (regexp). In this particular situation where the pattern...

mehr als 13 Jahre vor | 0

| akzeptiert

Beantwortet
Merging cell arrays with variable number of elements
x = {A, B{:}, C} ; In this expression, |B{:}| is a comma separated list (CSL); it is equivalent to listing |B|'s cells' cont...

mehr als 13 Jahre vor | 0

| akzeptiert

Beantwortet
colon operation (:) causes parfor to fail on cell array
It has a priori nothing to do with PARFOR; the expression involving the colon on the left hand side is a comma separated list (C...

mehr als 13 Jahre vor | 1

Beantwortet
Deleting Zero Rows - Matlab Noob
B(B(:,1)==0,:) = [] ;

mehr als 13 Jahre vor | 4

| akzeptiert

Beantwortet
[DISCONTINUED] MATLAB Answers Wish-list #2 (and bug reports)
An optional *chat room* with a *main channel* and *thread-specific channels* or user defined channels would be awesome. The rati...

mehr als 13 Jahre vor | 0

Beantwortet
Using TEXTSCAN to import an ASCII file with a header and blank lines between different data sets
An alternative could be to use REGEXP to get blocks of data, e.g. in a struct array, and then post-process the content. To illus...

mehr als 13 Jahre vor | 2

| akzeptiert

Beantwortet
Maximize similarity of vectors
I've never done anything like that, but you picked my curiosity so I gave it a quick try.. v1 = [1 1 2 1 2 3 3 1 1 2] ; v...

mehr als 13 Jahre vor | 0

Beantwortet
Finding durations between 1's in a matrix
If you had the following matrix |I| for example: >> I = rand(10,5) > 0.6 I = 0 1 1 0 0 0 1...

mehr als 13 Jahre vor | 0

Gelöst


Convert a cell-array of values to MATLAB source code
The MATLAB interpreter loads your code and executes it using the Read-Evaluate-Print-Loop (see <http://en.wikipedia.org/wiki/REP...

mehr als 13 Jahre vor

Beantwortet
How to randomly shuffle cards?
Look at the doc for RANDPERM. You can use it to shuffle a set of 1 to N integers: >> randperm(12) ans = 5 8 ...

mehr als 13 Jahre vor | 0

Beantwortet
How to avoid using a global variable in this case
I thought that you were talking about OOP with your initial question, but if not, it is not a good idea to overload common opera...

mehr als 13 Jahre vor | 0

Beantwortet
What is not "a finite, nonsparse, real integer vector" but looks like one? Error using circshift>ParseInputs (line 71)
>> A = rand(4) > 0.5 A = 1 0 0 0 1 0 1 1 0 0 0 1 0 1 1 ...

mehr als 13 Jahre vor | 0

Beantwortet
fgetl drops part of line
Could you copy/paste here the first 10-20 lines of one of these files? Have you tried to read the full file in one shot and then...

mehr als 13 Jahre vor | 0

Beantwortet
Matlab function/code similar to excel vlookup?
Look at this example: >> x = [1, 4, 2, 5, 3, 7, 6] ; % Fake x and y. >> y = x + 10 ; >> for k = 1 : 7, y(x == k), ...

mehr als 13 Jahre vor | 0

Beantwortet
Improve result of text file
If you evaluate class(R{3}) class(R{1:2}) you will realize that these are cells/arrays. You need to index one step furt...

mehr als 13 Jahre vor | 0

Beantwortet
Analysis and Prediction of Optimal Array Size of Pre-allocation.
Depending the nature of your computation, you can get an "analytical estimate", e.g. " _memory usage grows like_ |n^2|" for a gi...

mehr als 13 Jahre vor | 0

| akzeptiert

Mehr laden