Respondida
Encryption scheme operands?
You forgot a space in your definition: Alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ '; numbers = [1,12,7,5,2;18,1,27,27,27]; ...

casi 8 años hace | 0

| aceptada

Respondida
nearest tangent point from Ginput point to line ?
My <https://www.mathworks.com/matlabcentral/fileexchange/64396-point-to-line-distance FEX submission> should help here. Unlike w...

casi 8 años hace | 0

| aceptada

Respondida
How to modify this code for true result?
Your algorithm might not always result in an optimal packing. You should start with the biggest box and go down in volume. That ...

casi 8 años hace | 1

| aceptada

Respondida
Change matrix size for each successive experiment
Don't use |i| as a loop index, it may cause confusion/bugs and is trivial to avoid. m=1; for n = 101:100:2100 k =...

casi 8 años hace | 0

Respondida
Help me Understand why my First Array Index is invalid
You also have a warning in the lint on this line. The mlint is a very useful tool in debugging, so you should make sure you have...

casi 8 años hace | 1

Respondida
XTicklabels don‘t match
If you want full control over the ticks, you must set both the ticks and their labels explicitly. If you don't, it may depend on...

casi 8 años hace | 2

| aceptada

Respondida
final result depending on the consistency of ones and zeros
out0 = [1111000011110000] out1 = [1111111111111111] convert_to_1_bit=@(vector) mean(vector)>0.5; convert_to_1_bit...

casi 8 años hace | 0

Respondida
how to randomly delete number
Your code looks like you want to randomly fill one location with a one, but it has a bias toward the middle. The code below does...

casi 8 años hace | 0

| aceptada

Respondida
How To Amend Hints When Writing A Function
It is possible to do a lot if you are using the live editor. Otherwise it is very limited. Tab-completion tools have been doc...

casi 8 años hace | 0

| aceptada

Respondida
my code continuously showing undefined variable or function
There are two main problems with the loops you have set up: you run the risk of not defining your variables (which is causing yo...

casi 8 años hace | 0

| aceptada

Respondida
how to get summation of column-2 values by comparing column-1 values in matlab
You can use the |accumarray| function, although that will only work if the first column only contains non-zero integers. A=...

casi 8 años hace | 0

Respondida
How to ask for user's input in a program
You're already very close. You just need to follow the instructions: use |if| and |else|. You should be able to complete the res...

casi 8 años hace | 0

| aceptada

Respondida
Why changing a specific element in a vector matrix makes the unchanged elements zero?!
It doesn't change the values to 0. You are adding values with |rand| without considering the magnitude of the rest of the values...

casi 8 años hace | 0

| aceptada

Respondida
Matrix dimensions error must agree
If you edit your calls to |linspace| where you ask for a 4-element vector, the code exits without error. Since your code is a bi...

casi 8 años hace | 0

Respondida
Need helps with my unit step function
Your current code overwrites your output on every iteration. It looks like this is what you want: function [y] = unitstep(t...

casi 8 años hace | 0

Respondida
How to generate a 2D sphere matrix and not a disc
% r^2 = x^2+y^2+z^2 % so if you know r, and generate a field of x and y, you can calculate z r=200; [x,y]=ndgrid(...

casi 8 años hace | 1

| aceptada

Respondida
Subfunction help with triangles
You need to provide the subfunctions with inputs. function getinputs=righttri A=input('Enter side A:'); B=input...

casi 8 años hace | 2

Respondida
How to run all codes in single .m file??
You can either have a function at the top that runs internal functions, or you can just put all the code in a single script or f...

casi 8 años hace | 1

Respondida
Hello, I have a matrix of order 768 X 256. How can I downsample every alternate column. So that, every second column in the matrix is downsampled. So that new matrix will have order 768 X 128?. Kindly help me out.
This works the same, but in reverse from your <https://www.mathworks.com/matlabcentral/answers/422047-hello-i-have-a-matrix-of-o...

casi 8 años hace | 0

| aceptada

Respondida
Hello, I have a matrix of order 1664 X 128. How can I insert a column of zeros after every column. So that, every second column in the matrix is a zero column. So that new matrix will have order 1664 X 256?. Kindly help me out.
This should work. data=rand(1664,128);%generate data for example new_data=zeros(size(data,1),2*size(data,2)); new_dat...

casi 8 años hace | 0

| aceptada

Respondida
I have 2 data points representing x,y (0,3) and (4,0). What code do I use to plot a line or carry out a linear interpolation?
There are many ways to determine the formula for the line that passes through two points. One of the ways I find the easiest is ...

casi 8 años hace | 0

| aceptada

Respondida
Calling a function with 2 inputs using only a single input
You need to test for existence, not for being empty, as someone could still use an empty input. function out=function_name(...

casi 8 años hace | 1

Respondida
What does Windows 8.1 will not be supported after R2018b mean?
It means The Mathworks will offer very limited, if any, support for this release-OS-combination. Matlab 6.5 still runs on Window...

casi 8 años hace | 0

| aceptada

Respondida
finde some maximum values of matrix without collision!!!!
I suspect there is a better way with the sort function, but I can't come up with now. This should work. data=rand(4,6); ...

casi 8 años hace | 0

Respondida
How to multiply arrays in struct file with a variable?
The |load| functions loads to a struct, where each variable is a field, even when you specify only a single variable. The code b...

casi 8 años hace | 1

| aceptada

Respondida
Problem using function handles
Maybe you mean this? bisection(@f,0,2)

casi 8 años hace | 2

Respondida
I need a help?
You can set the y-scale to logarithmic with this set(gca,'YScale','log')

casi 8 años hace | 0

| aceptada

Respondida
How can i check a 3D object is located inside or outside of another 3D object?
Because your data is two logical arrays, you can easily test if the smaller is inside the larger. Finding out if the smaller obj...

casi 8 años hace | 0

| aceptada

Respondida
For uicontrol, why can't "UserData" property hold a structure but 'UserData' can?
One of the many places where using strings instead of char arrays will trip you up. I haven't searched for one, but I've never y...

casi 8 años hace | 0

| aceptada

Cargar más