Réponse apportée
Not enough input arguments error
% Call the function [tVec,xVec]=fxNthOrderPolysignal([0 10], [1 2 3 2 1]); % Define the function in the same file or separate ...

plus de 3 ans il y a | 0

Réponse apportée
I want to shift vector values one by one to the left
num=[1 1 1 0 0 0 0 0] for i=1:3 num = circshift(num, -1) end

plus de 3 ans il y a | 0

Réponse apportée
import text file using importdata
You data format is a special format. You can consider to read them as text and then extract individual information. Otherwise ...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
How to use the @ function calling when the function is defined as a variable?
MyfunctionStr='rand'; %'runf' Myfunction = str2func(MyfunctionStr); %[x,y,z]=@Myfunction x = Myfunction()

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
How to extract a string before a number?
str = 'abcd-xyzw-1.2.3.zip'; str2 = 'abcd_xyzw_2.3.1.zip'; idx = regexp(str, '\d'); sub_str = str(1:idx(1)-1) idx = rege...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Create text variable from one other
% Use char array Text = "Alex" Text1 = char(Text); Text2 = string(Text1(1:2:end))

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
why the figure of cos function does not symmetric around y axis?
p=[ ( 0.9000 - 0.0010i) (0.4243 + 0.0017i) (0.1000 + 0.3000i) ]; p1=[(0.9000 + 0.0010i) (0.2121 - 0.0008i) (0.1000 - 0.3000i...

plus de 3 ans il y a | 0

Réponse apportée
Chage elements of a matrix
Matrix = ones(5,4) n = numel(Matrix); Matrix(1:2:n) = randn(size(1:2:n))

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
How to create vector which is linear combination of a matrix
M = [1,2,3; 4,5,6; 7,8,9] vec= sum([2*M(:,1) 3*M(:,2) 4*M(:,3)], 2) % Alternatively vec =M*[2; 3; 4]

plus de 3 ans il y a | 1

Réponse apportée
Creating vector from a matrix
A = randn(3:4) v = A(1:2:end)'

plus de 3 ans il y a | 0

Réponse apportée
Code to input function
% fstr = input("Key in a function of x (eg. x.^2 + 2*x - 1): ", "s") fstr = "@(x) x.^2 + 2*x - 1"; % This is for on-line matl...

plus de 3 ans il y a | 0

Réponse apportée
Min between integer and empty array
X = [1,2,3,4,10,11]; Y = [1,2,3,4,5]; indice = min([find(X>10,1),find(Y>10,1)]) % use brackets

plus de 3 ans il y a | 2

| A accepté

Réponse apportée
my rand operation is applied correctly, I think but it's not working.
Check out the line: dOdt(i) = o(i); %o(1,:); ti = 0; tf = 10E-3; tspan=[ti tf]; y0=[1; 1; 0; 1; 1; 0; 1; 1; 0; 1; 1;...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Write data into existing PowerPoint Table
https://www.mathworks.com/help/rptgen/ug/update-presentation-content-programmatically.html Check out the above link in document...

plus de 3 ans il y a | 0

Réponse apportée
Why the image size changes after saving it to hard drive?
[o p q]=size(outputImage) % The above shows the size of the outputImage o =256, p=64, q=3 [o p q]=size('AA.jpg') % The above...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Real solution for a variable in an equation
V_plc=0.19; Kf=0.18; Kc=0.1; Kp=0.15; Kb=0.4; Kh=0.05; tau=0.18; Ktau=0.045; Vs=0.002; Kbar=1.5e-5; Ks=0.1; Vpm=1.59e...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Change marker and hide confidence bounds in Plotting multiple linear regression (fitlm)
load carsmall X = [Weight,Horsepower,Acceleration]; % Fit a linear regression model by using fitlm. mdl = fitlm(X,MPG); ...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
Perpendicular distance beween two 3D points
d = sqrt((x1-x2).^2 + (y1-y2).^2); % it does not depend on z

plus de 3 ans il y a | 0

Réponse apportée
The first argument must be a string array, character vector, or cell array of character vectors
You need to convert DecOriginTime into string that has similar format as MissingTimeList.

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
I want to find the number of decimal places, and my code is perfectly fine. But for some reason, when my value is 0.888, the length of the decimal is returned as 16.
MATLAB use IEEE double precision format for default numeric type. https://en.wikipedia.org/wiki/IEEE_754 The number of signifi...

plus de 3 ans il y a | 0

Réponse apportée
How to change selected pixels color value to 0?
% Get an indexed image Im = imread("peppers.png"); [Im, cmap] = rgb2ind(Im, 256); %whos pval = [ 231 71 115 207...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
How to use if and else statement for different tilmestep
Looks like you need to specify time(t) to be different values insead of a constant. q=[ 0.000585366 0.015219512 ...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
How to plot the average of the graphs ?
load(websave("SampleData", "https://www.mathworks.com/matlabcentral/answers/uploaded_files/1110305/Sample%20data.mat")) %whos ...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
3D plot, draw (X,Y,Z,value)
You can use scatter3 with marker size/color to represent value, though it is not a contour. xyzv = [ 1 1 0.000 1.000 ...

plus de 3 ans il y a | 0

Réponse apportée
Plot multiple edge sets on one graph?
% Create a graph A = magic(4); A(A>10) = 0; names = {'alpha' 'beta' 'gamma' 'delta'}; G = digraph(A,names,'omitselfloops')...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Display colorbar with evenly spaced tick intervals but unequal difference between tick values
image h=colorbar; % change ticks and ticklabels to the values you want h.Ticks=[0 10 20 30 40 50 100 200 255]; h.TickLabels ...

plus de 3 ans il y a | 0

Réponse apportée
I want to draw this step function by script code.
t = linspace(0,11)'; x = square(t*0.25*2*pi); min(x) plot(t,x) ylim([-1.1 1.1]) % Manually specify the points t = [0 5 5...

plus de 3 ans il y a | 0

Réponse apportée
Read the audio file given to you and play it from Matlab. Find the number of samples in the audio file (just the length of the array!) and the sampling rate.
Read the audio file given to you and play it from Matlab. doc audioread Find the number of samples in the audio file (just th...

plus de 3 ans il y a | 0

Réponse apportée
does 'VPA' changes the type of a data variable ?
vpa(x) uses variable-precision floating-point arithmetic (VPA) to evaluate each element of the symbolic input x. The input to x...

plus de 3 ans il y a | 0

Réponse apportée
Cell input to ode45 function
You can take all variables as an vector instead of cell array. For example, y = [X(t), S_1(t), ... S_7(t), P(t), V(t)]'. Then...

plus de 3 ans il y a | 0

| A accepté

Charger plus