Respondida
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'...

alrededor de 1 año hace | 0

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

alrededor de 1 año hace | 1

| aceptada

Respondida
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...

alrededor de 1 año hace | 1

| aceptada

Respondida
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...

alrededor de 1 año hace | 0

Respondida
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...

alrededor de 1 año hace | 0

| aceptada

Respondida
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...

alrededor de 1 año hace | 1

| aceptada

Respondida
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...

alrededor de 1 año hace | 1

Respondida
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...

alrededor de 1 año hace | 1

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

alrededor de 1 año hace | 1

Respondida
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 % ...

alrededor de 1 año hace | 0

| aceptada

Respondida
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

alrededor de 1 año hace | 0

| aceptada

Respondida
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(...

alrededor de 1 año hace | 1

Respondida
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 =...

alrededor de 1 año hace | 0

Respondida
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...

alrededor de 1 año hace | 0

Respondida
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()...

alrededor de 1 año hace | 0

Respondida
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 ...

alrededor de 1 año hace | 0

Respondida
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:...

alrededor de 1 año hace | 0

Respondida
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...

alrededor de 1 año hace | 0

| aceptada

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

alrededor de 1 año hace | 0

| aceptada

Respondida
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'); ...

alrededor de 1 año hace | 2

Respondida
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...

alrededor de 1 año hace | 0

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

alrededor de 1 año hace | 1

Respondida
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 = ...

alrededor de 1 año hace | 1

| aceptada

Respondida
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...

alrededor de 1 año hace | 0

| aceptada

Respondida
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 ...

alrededor de 1 año hace | 0

| aceptada

Respondida
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...

alrededor de 1 año hace | 1

Respondida
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...

alrededor de 1 año hace | 0

Respondida
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...

alrededor de 1 año hace | 0

Respondida
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 ...

alrededor de 1 año hace | 0

| aceptada

Respondida
how to read\scan all data of a row present in an array and pick data according to their priority number which is placed in next column of that particular row?
Hello Saira, for this particular case, asumming that priorities go between 1 and 10, this code can work: A = [1.2160, 7; ...

alrededor de 1 año hace | 1

| aceptada

Cargar más