Answered
With ischar usage - I get two different answers
"Why is that?" Because a character array (char) and a string array (string) are different. They are both different data types f...

2 years ago | 2

Answered
while iam trying to execute my code iam getting error
Numeric arrays in MATLAB are homogenous. When you initialize h(1) as a double array, then any elements to be added to it are e...

2 years ago | 0

Answered
How to write an exponent in an axis label when the matlab syntax doesn't work?
Try this - t = -5:.01:5; x = exp(t/10); figure(1) scatter(x,t,24,'filled') xlabel('t') ylabel('e^{(t/10)}')

2 years ago | 1

Answered
how to change zero in series number
Assuming the last element is not zero - in = [0 2 3 5 1 6 0 0 3 4 7 2 0 6 2].'; idx = in==0; while any(idx) in(idx) =...

2 years ago | 1

Answered
reverse operation to 'strsplit'
Use strjoin

2 years ago | 0

| accepted

Answered
Create Subparts in one problem on MATLAB grader
Yes, in addition to tests provided by the MATLAB Grader, you can include your custom assessments. See the documentation for > F...

2 years ago | 0

Answered
calculate the perimeter of a polygon arranged in space
I am not sure what the idea behind that method is, but it does not give the correct result - load plane_new figure x = plane...

2 years ago | 0

| accepted

Answered
Code for Delay differential analytical Solution. Its showing error. Please correct it. Kindly do the Needful.
There is missing operator between k and the left parenthesis as shown below - Fix it and the code will work. t=linspace(0,120...

2 years ago | 0

Answered
Setting a textbox returning error 'Unable to resolve the name'
The function does not know what "S" is. You need to pass it as an input. And the font name 'Comic Sans MS' does not have ellips...

2 years ago | 0

Answered
Using "if" and "disp" in a comparison of two numbers
You need to use the elseif condition. Refer to the documentation for more info - if, elseif, else a=5;%input("Give a value f...

2 years ago | 0

| accepted

Answered
Grab 20 lines and make a graph
"Can anyone tell me?" I assume you wanted to ask why that happens. You have provided a matrix as the single input to plot. ...

2 years ago | 0

Answered
Relative pose in 2D: problem 1
Given that the frame of reference is a cartesian co-ordinate system, the angle is supposed/expected to be calculated w.r.t x-axi...

2 years ago | 0

| accepted

Answered
Where is the month, day and year string stored in a plot with a datetime axis which shows hours and minutes in the xticklabel string?
The data is stored as the x-tick values. They can be edited, but not all properties can be changed. One option to specify form...

2 years ago | 0

Answered
Error using fopen for obj file
You should try these functions instead of fopen - https://in.mathworks.com/matlabcentral/fileexchange/27982-wavefront-obj-tool...

2 years ago | 1

Answered
How to plot these figures into a graph with tons of data
Assuming that you want to plot using the values in the 1st column as x-values - Firstly, you would need to convert the 1st colu...

2 years ago | 0

Answered
Obtaining max value from cyclic data
For each cycle, finding the maximum of the temperatures corresponding to the step == 3; %Read the data T = readtable('Referenc...

2 years ago | 0

| accepted

Answered
Create a loop with doubling the previous number minus 1
Use a while loop and perform the operation in each iteration - %Starting value x = 2; %Run the loop till the value of x is...

2 years ago | 1

Answered
How to create a long matrix rapidly
ones does exist, but using eye would be easier and faster here - n = 10; x = 1 - eye(n)

2 years ago | 1

Answered
Square wave with randomly varying frequency
The increment in time vector too small to clearly resolve the output wave-form. You can either zoom into parts of wave form to ...

2 years ago | 0

Answered
Meshgrid on inhomogeneous surface plot
To modify the lines on the surface, you will have to modify the underlying data. You might not be able to get the exact shape, ...

2 years ago | 0

Answered
the size of picture show three data?
It does not result in 3 images. That is a single image only, which is stored as a 3D array. That is a RGB image, also referred...

2 years ago | 0

Answered
Determining area considering nodes arranged in space in an almost circular shape
Directly use polyarea - load('plane_new.mat') x = plane_new(:,1); y = plane_new(:,2); plot(x,y,'.-r') A = polyarea(x...

2 years ago | 1

| accepted

Answered
I need to keep only specific columns from the .csv table
%Read the data tb = readtable('satellites-16-Jan-2024.csv', VariableNamingRule="preserve") %Compare the values from 2nd column...

2 years ago | 0

| accepted

Answered
Revert y-axis order in BarPlot
There are multiple ways to do that. One simple way is reverse the Y-axis direction (assuming the data is originally sorted des...

2 years ago | 0

| accepted

Answered
Adding and dividing elements in a 3D array
A = rand(15,5,120); B = (A(1:end-1,:,:) + A(2:end,:,:))/2 size(B)

2 years ago | 1

| accepted

Answered
How could I fix the parsing error on line 8
The most notable issue I can see is the un-supported character in the 8th line before the fix() call, which appears as a box. R...

2 years ago | 1

Answered
How change only second number in a=ones(1,10)?
Simply use indexing to change the element - a = ones(1,10); a(2) = 2

2 years ago | 0

| accepted

Answered
一つの3次元座標軸内に複数の球面をプロットしたい
They are plotted in 3D, you just need to change the line of sight. Check view for more information. D = [4.8115220,1.5733090,1...

2 years ago | 0

| accepted

Answered
What hardware Matlab Online uses?
As MATLAB Online runs on a Linux OS, run this command and see the output - system('lscpu')

2 years ago | 2

| accepted

Answered
changing expression to function
You will have to define x and y as symbolic variables first - %Random values for example a = rand(1,10); b = rand(1,10); ...

2 years ago | 0

Load more