Respondida
Gradient of vector-valued function
use diff instead of gradient which is equivalent for gradient operation for symbolic expressions syms a b1 b2 t mfcn = matlab...

más de 3 años hace | 0

Respondida
Different size definition in Matlab and Simulink
It seems you are accessing 2 elements of array *data* with each representing 4 byte register address. Each element of which has ...

más de 3 años hace | 0

Respondida
any idea how i can compute the elapsed time in each iteration in for loop ?
Read about commands *tic* and *toc*

más de 3 años hace | 0

| aceptada

Respondida
Hi, I'm new to this forum and appreciate very much your help! How to separate the results in for-loop?
clc clear A = 5; k = 1 for pe=[1 5 7 9] n(k)=pe*1.5; C(k)=n(k)*A;k = k+1; end

más de 3 años hace | 0

Respondida
Is it possible to only plot specific graph in a for loop?
t = 0:0.01:2*pi x = [3 7 8]; for k =1:length( [3 7 8]) y(k,:) = sin(t.*x(k)); end plot(t,y) legend('x = 3','x =7','x=8')...

más de 3 años hace | 1

| aceptada

Respondida
How to store the existing value in a array format. Here I have given the charging and discharging limits but it does not check it properly. can anyone help me to sort out this
f_SOC(i) = i_soc-(pevdchg*(i))/cev*100 %soc discharging equation May be you mean i_soc instead of temp in discharging cycl...

más de 3 años hace | 0

Respondida
why do i get an error in my code?
TT = load("stormData"); Load the data into variable nd use it in groupsummary summaryRegionCosts= groupsummary(TT, "...

más de 3 años hace | 1

Respondida
Kindly help me with this problem of groupsummary
TT = load("stormData"); summaryRegionCosts = groupsummary(TT, 'Region',{"min","max","median","mean"} , 'Total_Cost'); storm...

más de 3 años hace | 0

Respondida
Nested For Loop/Newton Raphson
x0 = 1.5; %x0 represents Mach Number Initial Guess AR = [1.8652 1.5472 1.3327 1.1793 1.0827 1.0258 1.0016 1.0302 1.1091 1.189...

más de 3 años hace | 1

Respondida
multiplication of matrices with different sizes
Use a cell array for s s{m}=(inv(C*o).*o.*PC.*inv(C.*o).*C);

más de 3 años hace | 0

Respondida
I can keep getting this error. Index exceeds the number of array elements. Index must not exceed 1.
t = zeros(1,t_reach); %hr X = zeros(1,t_reach); S = zeros(1,t_reach); P = zeros(1,t_reach); V = zeros(1,t_reach); Sa...

más de 3 años hace | 0

Respondida
How to convert das decimal number to binary code and directly write into matrix columns?
D = [0 4 3 7 2 5 6 7] F = dec2bin(D) % dec2bin use dec2bin function

más de 3 años hace | 0

Respondida
Getting outputs from a uifigure when a button is pressed
field1 = uidropdown(gui_fig,'Items',opt_list,'Editable','on','Position',[64 143 329 22],'Value','Text1'); uilabel(gui_fig,'te...

más de 3 años hace | 0

Respondida
How do I plot Streamlines of velocity components of spherical coordinate system?
verts = stream2(Xi,Yi,ui,vi,R,Th); streamline(verts);

más de 3 años hace | 0

| aceptada

Respondida
How can i fix this code with ploting a function
fplot(@(x) 16*exp(0.25*x),[0 10]) % exp is exponential function,

más de 3 años hace | 0

Respondida
How can I create a solid line from the data within a for loop?
k =1; for i = 0:0.2:100 U(k) = 1.48/(U_rev + ((r1+d1)+(r2*T)+(d2*p))*(i*50) + (s * log((t*(i*50))+1))); F(k) = (((i*50)^2)/...

más de 3 años hace | 0

| aceptada

Respondida
Unable to compute taylor expansion using taylortool
Since you are using a Edit box to read the function, it returns a string expression A = 1.176*x*cos(x); % A is variable to rea...

más de 3 años hace | 0

| aceptada

Respondida
error getting unable to open file
Begin the filenames with characters , forcedisp1 = readtable("c2.csv"); % use characters first forcedisp2 = readtable("c3.csv...

más de 3 años hace | 1

Respondida
Matlab Coder error : converting datetime Format error
Use the dateType argument for the datetime function d1 = datetime(DateTime, 'dateType', 'yyyymmdd'); % use the dateType argume...

más de 3 años hace | 0

| aceptada

Respondida
Hide the size of a table without using disp?
X = randi([0 10],10,1); Y = randi([0 100],10,1); % display table with size T = table(X,Y) % display table without showing s...

más de 3 años hace | 0

Respondida
integral command with function handle
May be you have function defined with a name integral. Check the working folder where you might have such function and which tak...

más de 3 años hace | 0

| aceptada

Respondida
fouriertransform with piecewise function
use double and subs() the result of x figure(1); syms t x = piecewise(-1/2<=t<=1/2, 1-abs(t), t<-1/2, 0 , t>1/2, 0) fplot(x,...

más de 3 años hace | 1

| aceptada

Respondida
How can I show the error message when the input data get wrong?
prompt = {'Start Year:','End Year:'}; dlgtitle = 'Year Range (Between 2000 and 2019)'; dims = [1 50]; answer = inputdlg(promp...

más de 3 años hace | 0

| aceptada

Respondida
How can I merge the matrices that produce different dimensions in the loop
Use [ ] inside the loop for k = 1:10 A = rand(5,3); B = rand(6,3); C = rand(3,3); D = rand(2,3); Merge(:,:...

más de 3 años hace | 0

Respondida
hold on producing separate graphs
I = 1:10; figure x = I y1 = 4*I.^2 hold on plot(x,y1) % figure x = I y2 = 4*I.^1 hold on plot(x,y2) % figure x ...

más de 3 años hace | 0

| aceptada

Respondida
I don't know how to make it repeat 10 times and save all input numbers into text file in a human readable format...Can anyone help me pls?? here's my the question and my code:
K = 1:10; for k = 1:numel(K) num = randi([-1 256],1); % input('Enter a number between 0 and 255:') disp("<"+num+">");...

más de 3 años hace | 0

| aceptada

Respondida
Triangle, sawtooth plot
f = 1 t=0:0.01:5; y = 4*abs(f*t-[floor(f*t+1/2)])-1; plot(t,y) f = 0.2 t= 0:0.01:5; y = 2*(mod((f*t),1/2))*f - 1; plot(...

más de 3 años hace | 0

| aceptada

Respondida
How do I plot this function A, i dont have syms so i need to plot it without that! Thanks!
clear all close all A = @(r) -.125*r+(1.125/r); figure(1); fplot(A,[-5 5])

más de 3 años hace | 0

Cargar más