Answered
Equally spaced points in a circle
Change the current_angle formula and use i instead of (i-1) %Random points with (x1,y1) - center point %and (x2,y2) - point on...

3 years ago | 0

| accepted

Answered
Is there a way to speed up the computation of a piecewise defined function?
Logical indexing would be my best bet - x_input=-2.12345; n = -10:10; %x is same as n %preallocate y y = zeros(size(n)...

3 years ago | 0

| accepted

Answered
my solve cant work again
You can use vpasolve to solve the equation numerically - format long s_length=0.125; m=0;n=0; a=-s_length/4+m %location of a...

3 years ago | 1

| accepted

Answered
xticks and yticks with decimal exponents
% My attempt %You can directly plot on log vs log scale via loglog() loglog(10^(0):10^(3),10^(-8):10^(3)) %set(gca, 'XScale...

3 years ago | 2

Answered
Plot a region based on inequalities
That happens because the markers of the scatter plot are circle in shape with a finite/comparable size. You can see that by plot...

3 years ago | 0

| accepted

Answered
Partition line in a subplot
You can do this by turning clipping off and manually drawing lines - clc;close all; clear all; x=[1 2 5 4 6 7]; y=[5 6 2 5 8...

3 years ago | 0

| accepted

Solved


Minimum number of crossings in a complete bipartite graph
This problem is related to problem 58389. A complete bipartite graph may be drawn in different ways, such that the number of li...

3 years ago

Answered
Constants that cannot be delete with CLEAR
You can use this command clearvars -except VariblesNotToBeDeleted

3 years ago | 1

Answered
gridmesh does not work for my case, why?
You need to use element-wise division as well in defining F u = rand(54,1); v = rand(61,1); [U,V]=meshgrid(u,v); % v F=...

3 years ago | 0

Answered
Different results from directly using fsolve function and using the code within program in fsolve setting
Using global is generally not recommended, specially when it is not required. There are many errors in your code, I have edited...

3 years ago | 0

| accepted

Answered
How to surf plot and line plot together for the code?
Any particular reason why you are using subs() for Gamma_star instead of defining manually it and vpa() for defining I? The cod...

3 years ago | 0

| accepted

Answered
How to extract month-wise data from a single column?
Read the excel file via readmatrix and use indexing to get the data for February. Make sure that the excel is present in the cu...

3 years ago | 0

| accepted

Answered
A compact “if” statement using “or” operator
Yes there is - ismember vec = [1 2 7 8 10]; i = 4; %Checks if elements in i are present in vec or not ismember(i,vec) if is...

3 years ago | 1

| accepted

Solved


Determine whether a number is prome
In discussing the unique factorization of numbers in Elementary Number Theory, Underwood Dudley devised a new number system: “C...

3 years ago

Answered
Problem 44951. Verify Law of Large Numbers
Hi @belva, 1 - There is an unsupressed variable, y, in the code, which has 100 million elements. Since it is unsupressed, MATLA...

3 years ago | 1

Answered
Create a plot of points on a circumference separated by radii
You can use a set of points and polarscatter to achieve this. What have you attempted yet?

3 years ago | 1

Answered
Removing rows except containing certain numbers of "33"
You are trying to compare numeric data with character data. You will have to convert your initial data to do that comparison. I...

3 years ago | 1

Answered
Summation of a Gamma series
This requires Symbolic toolbox - %Defining symbolic variables syms x n %summation using symsum() out = symsum(ExpressionToBe...

3 years ago | 0

| accepted

Answered
3D plot Between one known and two unknown parameter.
"In 2D, it will definitely give a circle." I assume you want to obtain all the circles corresponding to values in R in the same...

3 years ago | 0

| accepted

Solved


Draw '5' in Chinese.
Draw a x-by-x matrix '五' using 1s and 0s. Example: x=5 ans= [1 1 1 1 1 0 1 0 0 0 1 1 1 1 0 0 1 0 1 0 1 1 1 1 1] x=7...

3 years ago

Answered
Plotting in 3D
If you have already posted a question, add any related info to the same question. Do not post a new question with new informatio...

3 years ago | 1

| accepted

Answered
how i can fix this error?
@Armina Petrean, keep in mind that posting the picture of the code is not helpful. Even if we suggest a solution, it is not guar...

3 years ago | 0

Answered
Is this the right way to use permute and bsxfun?
Yes, it is correct. You can verify it by comparing it to the result obtained via loops - %Random data A = rand(1000,200,500); ...

3 years ago | 1

| accepted

Answered
Unrecognized function or variable 'a'.
You get an error because you have undefined variables in your code, that are a, b and c. If they have any numeric value, then a...

3 years ago | 0

Answered
How can I fix this "Error using / Matrix dimensions must agree."
I assume you want to do element-wise division, use "./" for that % Step 1: Define the parameters and initial conditions. B = ...

3 years ago | 1

| accepted

Answered
Symbolic rewriting of trigonometric functions with a exponential function.
rewrite() does not produce the following conversion. You can do the following - syms t %Define expressions separately y1 = (...

3 years ago | 0

| accepted

Solved


Create an empty array
Suppose you need an empty array. e = [] will give you one, but it's a double array, which may not help if you need a differen...

3 years ago

Solved


Find the circle inscribed in a triangle
Write a function that takes the x- and y-coordinates of three points describing the vertices of a triangle and returns the cente...

3 years ago

Question


Inconsisent(?) behaviour of str2num() with a particular usage
The task in hand for me was to generate an empty array corresponding to the class/datatype of the input. %Example 1 input = 's...

3 years ago | 2 answers | 0

2

answers

Answered
recreating mesh grid plot of polar formula
"Also i get my radian axis till 2000 instead of 6.28." Because your data spans from 2*pi to 2*pi*360 (~2262) instead of 0 to 2*...

3 years ago | 0

| accepted

Load more