Beantwortet
plotting a graph with 2 x-axis in a tile plot
I've found mysterious lines: t=tiledlayout(3,2) ax1=axes(t); ... ax3=nexttile % ??? ax3=axes(t); ... ax3=axes(t); % ?...

mehr als 4 Jahre vor | 0

Beantwortet
How to delete certain number of rows in each variable contained in a table which is contained in a structure?
Would the first 400 rows be: cropStart = 400; Data.Data(3).Dot_Data(1:cropStart, :) = [];

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
I am subtracting a 3x1 vector by another 3x1 vector and I am getting an error that my matrix dimensions must agree.
Use the debugger to examine the problem. Type in the command line: dbstop if error Then run the code again. When Matlab stops ...

mehr als 4 Jahre vor | 0

Beantwortet
Generating n bit random numbers with each bit sampled N times.
bin_seq = randi([0 1], 1, num_bit); result = repelem(bin_seq, 1, 100); Alternatively: result = reshape(repmat(bin_seq, 100, ...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
How to multiply each element with next one in the same row, then sum the product
A = [-1 -1; -1 1; 1 -1; 1 1]; nA = size(A, 2); B = [sum(A, 2), sum(A(:, 1:nA-1) .* A(:, 2:nA), 2)] The 2nd column of B is t...

mehr als 4 Jahre vor | 0

Beantwortet
Problem in using mxSetPr with USHORT
Either use memcpy instead of copying the data in a loop. Or use mxSetData instead of mxSetPr, if you are really sure, that the ...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
Matlab doesn't show imaginary part of complex numbers for me!
Do you see the 2 trailing zeros? This looks like the "bank" format: format long g pi + 2i format bank pi + 2i Solution: Do ...

mehr als 4 Jahre vor | 0

Beantwortet
Runge-kutta results do not align with ODE45 solver, what am I doing wrong?
You are using wrong initial values in the Runge Kutta method: % X(:, 1) = RHS(0, V0); Nope! X(:, 1) = V0; The inital values ...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
Error when attempting to activate license - Host ID is not valid
Spaces? Is the 2nd character an uppercase o? Type it again: 20BE526B . I have troubles opening the page with my license current...

mehr als 4 Jahre vor | 0

Beantwortet
How to extract random subset of images from a cell array?
Of course randperm works with cell arrays: random_subset = im_(randperm(numel(im_), 100)); This selects 100 elements in random...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
getappdata / setappdata does not work for me?
After the line figImage = figure; the variable figImage contains the handle of the figure. If you want to use this handle in a...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
What is the equivalence startup fcn in Guide?
I assume you mean the CreateFcn.

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
Undocumented startup option / Starting MATLAB GUI from Java
As far as I remember, starting Matlab with the Java VM was optional in Matlab 4 or 5. So you could enable the JVM manually. Ther...

mehr als 4 Jahre vor | 1

Beantwortet
Determining smoothness of a trajectory
You have to start with a mathematical definition of what you call "smooth". Do you mean differentiable? This cannot work. There...

mehr als 4 Jahre vor | 0

Beantwortet
Check the flipped of 3D Array matrix
Do you mean: isequal(A, flip(A, 2)) If A is huge (e.g. 1 GB), this operation is not efficient, because it duplicates the Array...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
matlab structure to csv file
% [EDITED] Adjusted for comma separators: coef.header = {'mexico', 'france', 'berlin', 'italy', 'china', 'srilanka'}; coef.da...

mehr als 4 Jahre vor | 1

| akzeptiert

Beantwortet
How to fprintf a transposed matrix?
fprintf takes the argument elementwise as they are store in the memory. So: A = [7 11; 15 23; 9 7]; fprintf(' %d \t %d \t %d\n...

mehr als 4 Jahre vor | 0

Beantwortet
problem in plot while loop
k0 = 2 * pi / 0.6328 * 1e6; t2 = 1.5e-6; n1 = 1.512; n2 = 1.521; n3 = 4.1-1i*0.211; n4 = 1; m = 0; x = 1.512; t3 = 1e-...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
How to plot Multivariable ODE with conditions ?
You are asked to do this in Simulink, not in Matlab. In Matlab a numerical solution is a better idea than hoping, that there is...

mehr als 4 Jahre vor | 1

| akzeptiert

Beantwortet
Is there any way to code this on a different way?
No. This is the efficient solution already. To get the 100.th most frequent element, you have to determine the frequencies of al...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
requirements to install Matlab, need compilers or tools
You can keep the old Matlab version. If you need a compiler depends on what you want to do with Matlab. For the Coder, compilin...

mehr als 4 Jahre vor | 0

Beantwortet
how can I modify a triple "for" cycle to run faster?
Of course you have to pre-allocate. ntables = 50; nlines = 10000; ncolumns = 30; B = zeros(ntables, nlines, ncolumns); f...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
How can I rearrange a vector?
Some bold guesses of what you want to achieve: aa = [9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9]; a = aa; a(a >= 5) = 0 a = a...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
How do I avoid the error message "Index exceeds the number of array elements" in a for loop?
day(1):day(3) is the vector 1:13. Some other simplifications, which uses a counter to access the days: folder = 'C:\Users\Do...

mehr als 4 Jahre vor | 1

| akzeptiert

Beantwortet
How to vectorize the MATLAB code?
a = rand(1, 11); N = length(a); b = zeros(1,N - 1); for i = 1:N-1 b(i) = a(i) + a (i + 1); end % Vectorized 1: b2...

mehr als 4 Jahre vor | 2

| akzeptiert

Beantwortet
Variable "H" might be set by a nonscalar operator
If H is an array, what is the meaning of: if H < 0.5 ? The IF command requires a scalar condition. Therefore Matlab inserts an...

mehr als 4 Jahre vor | 0

Beantwortet
Why has matlab become extremely inefficient with global variables?
You do not use global variables, but a script. Although you declare the varaibels as globals inside the script, there is no need...

mehr als 4 Jahre vor | 0

Beantwortet
Rotating coordinate system inside loop
a=4; b=4; ab=a*b; Input=zeros(ab,2); for ii=1:a Input((ii-1)*a+1:ii*a,1)=(a-b:-2:-(a+b)+2)'+2*(ii-1); Input((ii-...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
why am I getting "Array indices must be positive integers or logical values"
The variable Fs has the value 5. Then the expression: Fs(0:(L/2)) is treated as indices. 0 is not a valid index. In addition F...

mehr als 4 Jahre vor | 0

Beantwortet
Subtraction is not working in while loop
If you do not change the value of the variable used in the condition of the while loop, this loop must run infinitly: x = rand;...

mehr als 4 Jahre vor | 0

Mehr laden