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'}

1 year ago | 0

| accepted

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

1 year ago | 0

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

1 year ago | 1

| accepted

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

1 year ago | 0

| accepted

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

1 year ago | 0

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

1 year ago | 0

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

1 year ago | 0

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

1 year ago | 0

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

1 year ago | 0

| accepted

Array indices must be positive integers or logical values
You can do this by Iout = double(Io)

1 year ago | 0

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

1 year ago | 0

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

1 year ago | 0

| accepted

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

1 year ago | 0

| accepted

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

1 year ago | 0

| accepted

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)

1 year ago | 0

| accepted

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

1 year ago | 0

| accepted

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

1 year ago | 0

| accepted

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

1 year ago | 0

| accepted

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

1 year ago | 0

| accepted

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

1 year ago | 0

| accepted

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

1 year ago | 0

| accepted

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

1 year ago | 0

| accepted

How can I use '\$...\$' Environment in xticklabel with matlab2tikz?
Just use xticklabels({'\\$1\\$','','\\$2\\$','','\\$3\\$','','\\$4\\$','','\\$5\\$',''}); rather than xticklabels({'\$1\$','','\$2\$','','\$...

1 year ago | 0

| accepted

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

1 year ago | 0

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

1 year ago | 0

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

1 year ago | 0

| accepted

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

1 year ago | 0

| accepted

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

1 year ago | 0

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

1 year ago | 0

| accepted