Answered

How to make a={'1','2','3','4'} to b={'1234'}

The simple way is a={'1','2','3','4'}; b = {[a{:}]} Answer b = 1×1 cell array {'1234'}

How to make a={'1','2','3','4'} to b={'1234'}

The simple way is a={'1','2','3','4'}; b = {[a{:}]} Answer b = 1×1 cell array {'1234'}

3 years ago | 0

| accepted

Answered

how do you sum using loop?

x=1:100; f=@(x)x.*(1+x); S=sum(f(x));%this should be ok %or use loop f=@(x)x.*(1+x); S=0; for i=1:100 S=S+f(i); end...

how do you sum using loop?

x=1:100; f=@(x)x.*(1+x); S=sum(f(x));%this should be ok %or use loop f=@(x)x.*(1+x); S=0; for i=1:100 S=S+f(i); end...

3 years ago | 0

Answered

How to form a sphere with 1's in a 3D matrix

If there is no scale factor effect with different directions: m = 80; n = 100; p=90; [px,py,pz] = meshgrid(1:n, 1:m, 1:p); ra...

How to form a sphere with 1's in a 3D matrix

If there is no scale factor effect with different directions: m = 80; n = 100; p=90; [px,py,pz] = meshgrid(1:n, 1:m, 1:p); ra...

3 years ago | 1

| accepted

Answered

How to sum the values when they are bigger than 25, 50, 75, (conditional) and they are from the same group?

That's quite simple, you don't need to compare them clc;clear ID = ['1_A' ; '1_A'; '1_A'; '2_B'; '2_B'; '3_C'; '3_C';...

How to sum the values when they are bigger than 25, 50, 75, (conditional) and they are from the same group?

That's quite simple, you don't need to compare them clc;clear ID = ['1_A' ; '1_A'; '1_A'; '2_B'; '2_B'; '3_C'; '3_C';...

3 years ago | 0

| accepted

Answered

How to i change the SNR to Vector?

SNR = -20:10:30; a(numel(SNR)) = helperModClassTestChannel(); for i = 1:1:SNR a(i).SNR = SNR(i); end

How to i change the SNR to Vector?

SNR = -20:10:30; a(numel(SNR)) = helperModClassTestChannel(); for i = 1:1:SNR a(i).SNR = SNR(i); end

3 years ago | 0

Answered

Why is it not taking the sqrt function, and how to fix it?

You should transform char format to double then do your work B = str2num(B); H = str2num(H); n = str2num(n); s = str2num(s);...

Why is it not taking the sqrt function, and how to fix it?

You should transform char format to double then do your work B = str2num(B); H = str2num(H); n = str2num(n); s = str2num(s);...

3 years ago | 0

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

3 years 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...

3 years 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...

3 years 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)

3 years 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...

3 years 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...

3 years 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...

3 years 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 = ...

3 years 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)

3 years 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...

3 years 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...

3 years 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...

3 years 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...

3 years 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...

3 years 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...

3 years 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...

3 years 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$','','$...

3 years 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...

3 years 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...

3 years 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...

3 years 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...

3 years 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...

3 years 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...

3 years 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); ...

3 years ago | 0

| accepted