Beantwortet
getting and printing data from matrix
Maybe your data are: X = [5 8 9 15 7 12; ... 1 3 2 3 1 2; ... 3 2 1 1 2 3]; If so, than...

mehr als 4 Jahre vor | 0

Beantwortet
How to append a vector to a cell array?
C = {[1,4,1], 0:10}; % The cell v = linspace(1, 10, 100); % The vector C{end + 1} = v; % Or: C{numel(C) + 1} = v;...

mehr als 4 Jahre vor | 2

| akzeptiert

Beantwortet
fwrite and MATLAB for a raid0 disk - Only one lane?
What about trying it as C-Mex? data = randn(1024, 1024, 1024, 'double'); %8 GB tic uglyCWrite(data); toc // Short hack, U...

mehr als 4 Jahre vor | 0

Beantwortet
How to bold in a sprintf function?
Ticks = linspace(0, 30, 7); ax = axes('XLim', [0, 30], 'XTick', Ticks, ... 'TickLabelInterpreter', 'latex'); for k = 1:...

mehr als 4 Jahre vor | 2

Beantwortet
how can we use dynamic memory allocation in matlab?
malloc and calloc is performed by: a = zeros(1, 1e6) A free is useful under rare conditions also (huge arrays, memory exhauste...

mehr als 4 Jahre vor | 0

Beantwortet
Solving transcendental equation numerically
You can check this using the debugger. Type this in the command window: dbstop if error Now run the code again. When Matlab st...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
Profiler: time spend at while END statement
I interprete the displayed "times" as a a general problem of the profiler: Matlab's JIT can reorder commands and find abbreviati...

mehr als 4 Jahre vor | 1

Beantwortet
Screen.mexw64 file missing or inaccessible on my MATLAB path
The message explains: This mex file seems to be missing or inaccessible on your Matlab path or it is dysfunctional: Screen.mexw...

mehr als 4 Jahre vor | 0

Beantwortet
Regarding portability of Matlab going from Windows to Linux
I ran a large program (>300'000 lines of Matlab code) fluently after moving it from Windows to a Linux machine. This requires so...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
the meaning of a sentence in command window
It means, that the optimizer did not found a valid solution. The value of the fitness functions does not vary more than the para...

mehr als 4 Jahre vor | 0

Beantwortet
How to shade area between standard deviations in a plot?
data1 = load('mean.mat'); m = data1.mean; data2 = loadt('std.mat'); s = data2.sd; % Do not use "mean" and "std" as ...

mehr als 4 Jahre vor | 1

| akzeptiert

Beantwortet
How to let users enter integer, loop reenter again to them if they enter anything else
ready = false; while ~ready n = input('Enter number of patients : '); if ~isscalar(n) || n < 2 || n > 100 || abs(roun...

mehr als 4 Jahre vor | 0

Beantwortet
How to write data to a binary file at a specific position?
% Some test data storing the rows in different files: nRow = 10; nCol = 1e6; for k = 1:nRow [fid, msg] = fopen(sprintf('...

mehr als 4 Jahre vor | 1

Beantwortet
Read a file with textscan.
The file starts with this line: ###################################################################### This does not match the...

mehr als 4 Jahre vor | 0

Beantwortet
I need to create a for loop that begins at 0.01 and increases by a factor of 1.1 until reaching 24.
"I need to create a for loop" This means for or while. "that begins at 0.01" x = 0.01 "and increases by a factor of 1.1" x ...

mehr als 4 Jahre vor | 0

Beantwortet
Add a number to a region of cells bounded by nonzero numbers in a matrix
A = [0 0 0 0 0 0 0 0 0 0; 0 0 0 0 3 9 2 1 3 0; 0 0 2 4 1 0 0 0 0 0; 0 0 3 3 2 4 9 2 0 0; 0 5 1 3 0 0 4 2 0 ...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
Is this a MATLAB bug? (Logical expression)
(x1 | x2) is TRUE, if at least one of them is not zero. If both are zero, FALSE is replied. In the next step TRUE is converted t...

mehr als 4 Jahre vor | 2

| akzeptiert

Beantwortet
How to speed up the code to check if randomly generated number in a certain range is a prime ?
Avoid to call isprime repeatedly. If the numbers are limited, check only once, if they are prime: m = false(1, 48593); m(prime...

mehr als 4 Jahre vor | 0

Beantwortet
problem in showing result
Matlab evaluates an expression from left to right. So there is no difference between 610000 <= x11 <= 33683000 and (610000 <=...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
Run another script via run parameter
The best way is to avoid scripts and to use functions instead. Scripts increase the complexity of the code, because side effects...

mehr als 4 Jahre vor | 0

Beantwortet
Optimization of a matrix variable
By: a = z; % instead of z(N:L) ? This looks trivial, so do I oversee a detail?

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
How to reduce the decimal places if I want to save the mat file from the workspace?
There are two options: Use a MAT format with compression: -v7.3 . See: doc save Convert doubles to singles or (U)INT32/16/8 a...

mehr als 4 Jahre vor | 0

Beantwortet
Loop through same procedure for different inputs.
cnt = 15; % centre point (s) fqn = 200; % scale factor (Hz) for t = [5, 10, 20] % time period (s) LBD = fq...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
why will my function not take my array 'slope' as an answer. I am writing code to differentiate an equation by finding the average gradient.
If n==6, you request x(7) in: dx = x(n+1)-x(n); There is no x(7). y(n+1) must fail also. The error message is clear. There ar...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
Convert ASCII file numbers to a date/duration
t = [500.00; 121314.15; 235500.00]; mod([floor(t / 10000), floor(t / 100), t], 100) d = duration(mod([floor(t / 10000), floor(...

mehr als 4 Jahre vor | 2

Beantwortet
ode45,Too many output arguments error
The complete error message is (remember to include it in a question, whenever an error occurs): The Problem occurs here: fun...

mehr als 4 Jahre vor | 1

| akzeptiert

Beantwortet
How to shuffle rows in pairs in a 600 x 2 matrix that only contains integers?
A = [10 1; ... 30 2; ... 50 1; ... 70 8; ... 90 3; ... 10 5; ... 40 6; ... 50 2]; s =...

mehr als 4 Jahre vor | 1

| akzeptiert

Beantwortet
m file code sometimes loss a "end" and corruput the file on hard disc.
It is extremely unlikely, that the 3 characters "end" vanish inside a text file, while the rest of the computer runs without a c...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
How to check for reversed pairings in columns of a matrix?
A = [1 2 5 6 0 2 3 5 6 7 1 8 0 2; ... % Value appended!!! 2 1 7 6 2 0 2 0 0 1 1 1 1 1; ... 3 5 0 1 5 8 2 0 0 2 3 0...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
is it possible to slow down CPU to an arbitrary pace?
I do not know a tool to reduced the CPU speed freely. Even if there is such a tool, you cannot compare a modern multi-core CPU ...

mehr als 4 Jahre vor | 0

Mehr laden