Beantwortet
An unexpected discrepancy between xcorr, xcov and autocorr
When in doubt always read the documentation. doc xcov Matlab functions are very good documented. For example, you can read: x...

mehr als ein Jahr vor | 0

Beantwortet
Why I couldn't plot this graph f=(@(x,y) (x.^2)+(x*y)+(y.^2)<=68200.^2/3);
And if you really insist on 68200^2/3, then this code will provide output f=@(x,y) x.^2+x.*y+y.^2-68200^2/3; fimplicit(f, 'b'...

mehr als ein Jahr vor | 0

Beantwortet
Can I make this line of code smaller?
XBest=[2, 3, 4]; XBest(isempty(XBest)) = 1e8; XBest XAest = []; XAest(isempty(XAest)) = 1e8; XAest

mehr als ein Jahr vor | 1

| akzeptiert

Beantwortet
Why the 2nd code does not behave like the 1st code?
This is how I would modified the code to execute for any M r N dimensions: clear clc u = [10 20 30 40]; b = u * (1+0.5*randn...

mehr als ein Jahr vor | 1

| akzeptiert

Beantwortet
Unable to perform assignment because brace indexing is not supported for variables of this type
You need to provide more context. For example, this is OK. run = cell(10,1); R = 244:300; Y = 1:300; run{1} = Y(1:R(1)) ru...

mehr als ein Jahr vor | 0

Beantwortet
How to get subset of data from given thresholds?
Did you try this approach? DNS = dat(:,9); NZE = dat(:,10); PER = dat(:,11); % 1. sub = dat(NZE>0.25,:); %2. sub = da...

mehr als ein Jahr vor | 0

| akzeptiert

Beantwortet
How to read a specially structured data file with different structures
I would suggest the follwoing solution: A = readtable('test.5p', 'ReadVariableNames', false, 'FileType', 'text'); nr_rows = si...

mehr als ein Jahr vor | 1

| akzeptiert

Beantwortet
Why the 2nd code does not behave like the 1st code?
It is because in the function "myfunAskMathworks.m" you have function handles defined. So, you are sending the function handle a...

mehr als ein Jahr vor | 1

Beantwortet
How to read a specially structured data file
I would also like to suggest my naive and inefficient approach: A = dlmread('testfile5p.txt'); nr_rows = size(A,1); A2 = zero...

mehr als ein Jahr vor | 1

Beantwortet
how to plot a mean line in a plot
Perhaps, you can use this code: plot(t1,x.*t1);

mehr als ein Jahr vor | 1

Beantwortet
Hi! How I can extract specific data
Hello Aknur, This example code will perform task you specified. % code which will take exactly data where the last three % ...

mehr als ein Jahr vor | 0

| akzeptiert

Beantwortet
Solving a system of equations with dependent variables symbolically
syms a b c d x z y s sol = solve([y==a*b-c,z==d*a+b,x==c*a+b,s==c*b-a],[a,b,c,d],'Real',true) sol.a, sol.b,sol.c, sol.d

mehr als ein Jahr vor | 0

| akzeptiert

Beantwortet
I would like to count the number of peaks of a signal.
t = 0:0.01:2; y = sin(20*t); [z, ind] = findpeaks(y); plot(t,y) hold on plot(t(ind), z, 'o') number_cylces = numel(diff(...

mehr als ein Jahr vor | 1

Beantwortet
reorder data in a matrix
It seems to me that you want this logic implemented: A = ["10010" ; "11000" ; "11010" ; "01100" ; "01011"] N = numel(A); B =...

mehr als ein Jahr vor | 0

Beantwortet
How to know the data set after augment?
This is an extract from the documentation: % transform Create a new datastore that applies a function to the % data rea...

mehr als ein Jahr vor | 0

Beantwortet
Intersection of two tables
Maybe this code can help you: A = table(); A.user = {'user1';'user2';'user3';'user4'}; A.value = [10;20;30;40] B = table()...

mehr als ein Jahr vor | 0

Beantwortet
Problems using Linear Regression and syntax
Can you clarify what exactly is the problem with Matlab syntax? Here is what is obtained if your code is executed: clear clc ...

mehr als ein Jahr vor | 0

Beantwortet
What is the answer of [(4 -2 ) /2 , 5 +6 , 7 , 8 ] ? Why does MATLAB output [1 5 6 7 8]?
In Matalb, when you define an array (or vector) you can use the following syntax: v = [1 3 4 5 6] This is exactly the same as:...

mehr als ein Jahr vor | 0

Beantwortet
Error using Solve with symmatrix equation
The function solve doesn'tsupport symmatrix. One way to solve matrix equeation is the follwoing: A_r = [3 -6; 5 2]; B_r = [7 4...

fast 2 Jahre vor | 0

| akzeptiert

Beantwortet
Creating a matrix based on sorted values from another matrix
[As, ind] = sort(A); C = [As;B(ind)]

fast 2 Jahre vor | 0

| akzeptiert

Beantwortet
How to have two legends on the same plot?
Perhaps you meant this: t = 0:0.1:5; y = sin(t); z = cos(t); figure; hold on; for i = 1:2 p1(i) = plot(t, y,'r'); ...

fast 2 Jahre vor | 2

Beantwortet
why do i get the error using alpha too many output arguments, can anyoen help please.
You didn't define variable alpha. Because of that, Matlab thinks you want to use built in functionality: help alpha alpha - Ge...

fast 2 Jahre vor | 0

Beantwortet
How to remove noise (unwanted data)
I would suggest the following approach: % read file into table %T = readtable('KLOG0024.csv'); outfile = websave('KLOG0024.cs...

fast 2 Jahre vor | 1

Beantwortet
Invalid indexing or function definition. Indexing must follow MATLAB indexing. Function arguments must be symbolic variables, and function body must be sym expression.
If you want to define equations eq1, eq2 and eq3, you need to use function handles: syms v2 v3 I2 v1 = 20; del_t = 0.5; R = ...

fast 2 Jahre vor | 1

| akzeptiert

Beantwortet
Help implementing code (Newton-Raphson)
@Allan I would like to suggest somewhat simpler code: maxIter = 200; maxTol = 1e-14; V0 = linspace(0, 10, maxIter); % para...

fast 2 Jahre vor | 0

| akzeptiert

Beantwortet
Index error: must be logical or positive integer.
T=10:2:60; f=-1:length(T)+1; total=-1; i=f+total; et=3.5e-4; dn1=1e-9:100e-9; size(dn1) size(i) if i==0 r=0; else ...

fast 2 Jahre vor | 0

| akzeptiert

Beantwortet
Array indices must be positive integers or logical values.
It seems to me that you actually want this: [t,y]=ode45(@problem03ODEFunction,[0 20],[2 0 0]); plot(t,y(:,1)) hold on; gri...

fast 2 Jahre vor | 1

Beantwortet
HPF doesn't work in time-domain convolution
Please have a look at this code. This is to confirm that multiplication in freq. domain and convolution in time domain will prov...

fast 2 Jahre vor | 0

Beantwortet
how do i write a matlab script to sum this expression
Matlab has a built in function called rmse, so there is no need to write a Matlab script, unless this is a homework. In that cas...

fast 2 Jahre vor | 0

Beantwortet
Compare of symbolic expression for trigonometric
Perhaps, this is the way to go with sym expressions: isAlways(A == B) isAlways(cond) checks if the condition cond is valid ...

fast 2 Jahre vor | 0

| akzeptiert

Mehr laden