Answered

plot the equation graph

Hi, It is not neccessary to solve this equation x = 0:0.00001:1; f = @(x,m,a)(m*pi+atan((x)/(1-x))+atan((a+x)/(1-x)))./sqrt(1...

plot the equation graph

Hi, It is not neccessary to solve this equation x = 0:0.00001:1; f = @(x,m,a)(m*pi+atan((x)/(1-x))+atan((a+x)/(1-x)))./sqrt(1...

5 months ago | 0

Answered

How to plot mean with respect to bins?

Hi friend, Use histcounts and histogram, then the work is done clc;clear value = rand(100,1) + 0.1; % lack of your data, i ge...

How to plot mean with respect to bins?

Hi friend, Use histcounts and histogram, then the work is done clc;clear value = rand(100,1) + 0.1; % lack of your data, i ge...

5 months ago | 0

Answered

hot to plot horizontal Histogram??

Try to do this counts = [0 664 320 316 664 664 664 664 320 320 664 664 664 664 664 240 664 229 664 664]; Substances = 'abcdefg...

hot to plot horizontal Histogram??

Try to do this counts = [0 664 320 316 664 664 664 664 320 320 664 664 664 664 664 240 664 229 664 664]; Substances = 'abcdefg...

5 months ago | 0

| accepted

Answered

Array indices must be positive integers or logical values

You can do this by Iout = double(Io)

Array indices must be positive integers or logical values

You can do this by Iout = double(Io)

5 months ago | 0

Answered

how to solve a second-order differential equation set with parameter using Euler's method?

Actually, dy is the derivative of y with respect to t. The code you give is absolutely right. So you see Euler's Method If y...

how to solve a second-order differential equation set with parameter using Euler's method?

Actually, dy is the derivative of y with respect to t. The code you give is absolutely right. So you see Euler's Method If y...

5 months ago | 0

Answered

I want the same randomly split dataset for all the network so that i can compare the results.

You can save imdsTrain, imdsValidation for the first run And then use load to get imdsTrain, imdsValidation for three different...

I want the same randomly split dataset for all the network so that i can compare the results.

You can save imdsTrain, imdsValidation for the first run And then use load to get imdsTrain, imdsValidation for three different...

5 months ago | 0

| accepted

Answered

How to order a set of unordered points

Use boundary(x,y) function load('pts.mat'); x=X_pts(:,1); y = X_pts(:,2); k = boundary(x,y,1); plot(x(k),y(k)) set(gca,'Y...

How to order a set of unordered points

Use boundary(x,y) function load('pts.mat'); x=X_pts(:,1); y = X_pts(:,2); k = boundary(x,y,1); plot(x(k),y(k)) set(gca,'Y...

5 months ago | 0

| accepted

Answered

How to solve system of first order ODE's by forming matrix

Do not use syms, because without syms, the code runs faster A = [2 5 1; 7 9 0; 4 1 3]; odefun = @(t,Y)A*Y; tspan = ...

How to solve system of first order ODE's by forming matrix

Do not use syms, because without syms, the code runs faster A = [2 5 1; 7 9 0; 4 1 3]; odefun = @(t,Y)A*Y; tspan = ...

5 months ago | 0

| accepted

Answered

Calculating number in a string

Then do following code for i = 1:1:nLines fprintf('%d: %s\n',i,fileStr{i}) end fprintf('This file has %d lines', nLines)

Calculating number in a string

Then do following code for i = 1:1:nLines fprintf('%d: %s\n',i,fileStr{i}) end fprintf('This file has %d lines', nLines)

5 months ago | 0

| accepted

Answered

I want to throw the error that comes with entering a non number in a numeric only input

n = str2num(input('Please enter a number:\n','s')); if(isempty(n)) error('You are entering a non number in a numeric only inpu...

I want to throw the error that comes with entering a non number in a numeric only input

n = str2num(input('Please enter a number:\n','s')); if(isempty(n)) error('You are entering a non number in a numeric only inpu...

5 months ago | 0

| accepted

Answered

How do I only display the 5 answers in the command window once?

s = [1 2 3 4 5]; h = [1 2 3 4 5]; SA = zeros(size(s)); for i = 1:5 s1 = s(i); h1 = h(i); SA(i) = equTriPris...

How do I only display the 5 answers in the command window once?

s = [1 2 3 4 5]; h = [1 2 3 4 5]; SA = zeros(size(s)); for i = 1:5 s1 = s(i); h1 = h(i); SA(i) = equTriPris...

5 months ago | 0

| accepted

Answered

I want to find out vector subtraction of co-ordinates of 2 adjacent nodes of an element. How to proceed?

% if you have nodes and elements % nodes n-by-3 % elements m-by-8 % Then node1 = 1; node2 = 3; xrelative = abs(nodes(node1...

I want to find out vector subtraction of co-ordinates of 2 adjacent nodes of an element. How to proceed?

% if you have nodes and elements % nodes n-by-3 % elements m-by-8 % Then node1 = 1; node2 = 3; xrelative = abs(nodes(node1...

5 months ago | 0

| accepted

Answered

How to fix: Index Exceeds Matrix Dimensions

Hi, friend ode45 function outputs a struct with size 1x1 when only one argument is for output data. If you want to output x sol...

How to fix: Index Exceeds Matrix Dimensions

Hi, friend ode45 function outputs a struct with size 1x1 when only one argument is for output data. If you want to output x sol...

5 months ago | 0

| accepted

Answered

Why do I receive Not enough input arguments?

I just give a minor correction to your code function [SA]=equTriPrismSurfArea(s,h) SA=((sqrt(3)/2)*(s^2))+(3*s*h); end Save...

Why do I receive Not enough input arguments?

I just give a minor correction to your code function [SA]=equTriPrismSurfArea(s,h) SA=((sqrt(3)/2)*(s^2))+(3*s*h); end Save...

5 months ago | 0

| accepted

Answered

One Dimensional Laplace Equation with Source term.

Hi, friend I have found your boudary conditions are applied at the centre of control volumes of both ends rather than on the b...

One Dimensional Laplace Equation with Source term.

Hi, friend I have found your boudary conditions are applied at the centre of control volumes of both ends rather than on the b...

5 months ago | 0

| accepted

Answered

Creating a matrix of logical arrays using an exsiting matrix

Use eye num_labels = 10; Y = [1;2;3;4;3;2;4;5;3;3;5;7;8]; % example Y E =eye(num_labels)==1; Your_matrix = E(Y,:) Then You...

Creating a matrix of logical arrays using an exsiting matrix

Use eye num_labels = 10; Y = [1;2;3;4;3;2;4;5;3;3;5;7;8]; % example Y E =eye(num_labels)==1; Your_matrix = E(Y,:) Then You...

5 months ago | 0

| accepted

Answered

How can I use '$...$' Environment in xticklabel with matlab2tikz?

Just use xticklabels({'\$1\$','','\$2\$','','\$3\$','','\$4\$','','\$5\$',''}); rather than xticklabels({'$1$','','$2$','','$...

How can I use '$...$' Environment in xticklabel with matlab2tikz?

Just use xticklabels({'\$1\$','','\$2\$','','\$3\$','','\$4\$','','\$5\$',''}); rather than xticklabels({'$1$','','$2$','','$...

5 months ago | 0

| accepted

Answered

Adding constraints to function plots in 2-D and 3-D

Hi, I have translated the Cartesian to polar system so as to satisfy your requirement f = @ (x , y ) x .* sin( x .* y ); min...

Adding constraints to function plots in 2-D and 3-D

Hi, I have translated the Cartesian to polar system so as to satisfy your requirement f = @ (x , y ) x .* sin( x .* y ); min...

5 months ago | 0

Answered

what happened to my install ?how to solve this proplem?

你好，饶倩榕同学 在运行matlab安装程序之前，请关闭杀毒软件，特别是360；然后点击安装包安装时，请右键以管理员方式运行。 Hello, Rao Qianrong Before running matlab installer, please t...

what happened to my install ?how to solve this proplem?

你好，饶倩榕同学 在运行matlab安装程序之前，请关闭杀毒软件，特别是360；然后点击安装包安装时，请右键以管理员方式运行。 Hello, Rao Qianrong Before running matlab installer, please t...

5 months ago | 0

Answered

symbolic calculation for series

Hi friend, Just define U as a symbolic array, it works in my matlab syms x t syms U [5,1] % I think what you need is 5-by-1 m...

symbolic calculation for series

Hi friend, Just define U as a symbolic array, it works in my matlab syms x t syms U [5,1] % I think what you need is 5-by-1 m...

5 months ago | 0

| accepted

Answered

How can I count number of dates over 100 degree F?

dates = readtable('your_dates_file'); % assume that your dates fie has only one column temps = readtable('your_temperature_fil...

How can I count number of dates over 100 degree F?

dates = readtable('your_dates_file'); % assume that your dates fie has only one column temps = readtable('your_temperature_fil...

5 months ago | 0

| accepted

Answered

How to remove indexed set of rows from a cell array

Try this logical_indices = arrayfun(@(i)corb{i,1}(1)>100000&corb{i,1}(1)<300000,(1:1:size(corb))'); row_indices = find(logical...

How to remove indexed set of rows from a cell array

Try this logical_indices = arrayfun(@(i)corb{i,1}(1)>100000&corb{i,1}(1)<300000,(1:1:size(corb))'); row_indices = find(logical...

5 months ago | 0

Answered

write a 'for' loop numbers in a single row matrix

Hi, MOzhdeh Salimi Here I donot know your tiff file but I have written code for you! VF = rand(100,100); Tnormal = rand(100,1...

write a 'for' loop numbers in a single row matrix

Hi, MOzhdeh Salimi Here I donot know your tiff file but I have written code for you! VF = rand(100,100); Tnormal = rand(100,1...

5 months ago | 0

| accepted

Answered

Creating a mxn matrix that is all zeros except for the middle row and middle column which are 1s

M = [0,0,0,1,0,0,0; 0,0,0,1,0,0,0; 1,1,1,1,1,1,1; 0,0,0,1,0,0,0; 0,0,0,1,0,0,0]; Once for all Or you can do a = zeros(5,7); ...

Creating a mxn matrix that is all zeros except for the middle row and middle column which are 1s

M = [0,0,0,1,0,0,0; 0,0,0,1,0,0,0; 1,1,1,1,1,1,1; 0,0,0,1,0,0,0; 0,0,0,1,0,0,0]; Once for all Or you can do a = zeros(5,7); ...

5 months ago | 0

| accepted

Answered

How to plot multiple box plots on same graph with same size vector?

Hi, just change line 1 vol = [D1(:,1);C1(:,1)]; to vol = [D1(:,1), C1(:,1)];

How to plot multiple box plots on same graph with same size vector?

Hi, just change line 1 vol = [D1(:,1);C1(:,1)]; to vol = [D1(:,1), C1(:,1)];

5 months ago | 0

| accepted

Answered

Setting 3D plot's centre at origin

try this set(gca, 'XAxisLocation', 'origin', 'YAxisLocation', 'origin','ZAxisLocation', 'origin')

Setting 3D plot's centre at origin

try this set(gca, 'XAxisLocation', 'origin', 'YAxisLocation', 'origin','ZAxisLocation', 'origin')

5 months ago | 0

Answered

Squeezing NaN's out of a square matrix to make a smaller square matrix

[p,q] = size(M); M(isnan(M))=[]; M = reshape(M,p-1,q) Then M = 2 1 1 1 1 3 3 2 ...

Squeezing NaN's out of a square matrix to make a smaller square matrix

[p,q] = size(M); M(isnan(M))=[]; M = reshape(M,p-1,q) Then M = 2 1 1 1 1 3 3 2 ...

5 months ago | 0

| accepted

Answered

Number of Bacteria.

Here you can use symbolic solution syms N(t) t eq = diff(N)==log(3.32)*N N = dsolve(eq,N(0)==100) N_1dot5_hour = eval(subs(N...

Number of Bacteria.

Here you can use symbolic solution syms N(t) t eq = diff(N)==log(3.32)*N N = dsolve(eq,N(0)==100) N_1dot5_hour = eval(subs(N...

5 months ago | 0

| accepted

Answered

How to store conditional values during iteration by using Ode45?

You can define a table to store the data including the conditional values function main t0=0; tf=15; a0=1; T = table(); gl...

How to store conditional values during iteration by using Ode45?

You can define a table to store the data including the conditional values function main t0=0; tf=15; a0=1; T = table(); gl...

5 months ago | 1

| accepted

Answered

If statement in a for loop

You can do like this A = mat2cell(rand(40,40)+0.5, [10 10 10 10], [10 10 10 10]); % A is your data randomly generated, you ca...

If statement in a for loop

You can do like this A = mat2cell(rand(40,40)+0.5, [10 10 10 10], [10 10 10 10]); % A is your data randomly generated, you ca...

5 months ago | 1