Community Profile

photo

Luna


171 total contributions since 2018

Contact

Luna's Badges

  • 3 Month Streak
  • Revival Level 1
  • Knowledgeable Level 3
  • Thankful Level 1
  • First Answer

View details...

Contributions in
View by

Answered
How can I generate an array of binary data of this form?
Hi Luqman, Please see the code below and read the comments: N = 6; permutatedArray = [ones(1,N/2),zeros(1,N/2)]; % this cre...

5 dagen ago | 0

Answered
How to append number to array
Assuming that your function's outputs are 1x1 double, you can use below: S0=30; K=32; r=0.03; sigma=0.2; T=1; M=10; % er...

5 dagen ago | 0

| accepted

Answered
Making plots look beautiful
Hello Hari, I have just created a dummy data and plot them for you. You must check the line properties in documentation here t...

5 dagen ago | 1

| accepted

Answered
Index exceeds matrix dimensions
You can't use simulink as a variable name. simulink(i)=simulink1; % simulink is already a built-in function which starts simul...

8 dagen ago | 0

Answered
How to fill a 1024 point array with two cycles of a cosine wave?
You can use linspace. Example: xData = linspace(0,4*pi,1024); yData = cos(xData); figure; plot(xData,yData);

8 dagen ago | 0

| accepted

Answered
Change categorical array categories in table for use in uitable dropdown
Hi Vik, I don't know why it didn't work, I have tried what you did above. I tried exact the same thing with categorical variabl...

11 dagen ago | 0

Answered
access data in structure?
You are almost there. Try this: H0=struct('h',[0,0],'Q_centroid',[0,0],'Q_action',[.5,.51,.5,.51],'Q_table',[0]); H1=struct('...

12 dagen ago | 0

| accepted

Answered
Extract only numbers from a cell array.
Your data seems much more complicated than that and has commas inside cells as a char also. I have removed white spaces, +j s...

12 dagen ago | 0

Answered
How can I find which row has a specied values that I entered?
For example, A=[4 5 6 7; 8 4 5 6; 4 5 6 8; 8 4 8 9 ;1 2 2 4; 4 5 6 8]; % A matrix v = [4 5 6 8]; % vector you are searching f...

13 dagen ago | 1

| accepted

Answered
How can share the handles variable between two skripts?
@madhan ravi +1 If they are scripts, they should be created as methods of a class which is abstracted from handle superclass. ...

14 dagen ago | 0

| accepted

Answered
GUI Resizing Issue for Different Screen Resolutions
The best, easiest and effortless way to do it is using GUI Layout Toolbox from FEX. You will never need to implement SizeChang...

14 dagen ago | 1

Answered
How to use uiwait in GUI
Use waitfor instead. Waitfor pauses calculation until the object destroyed or deleted. figHandle = uifigure(..) % or you can c...

14 dagen ago | 0

| accepted

Answered
Basic power rule ((a^b)^c = a^(b*c)) does not work
By the definition Euler's equation: z = x + iy means So the two things might be different: and x2 = exp(b*c) is e...

18 dagen ago | 0

Answered
link axes of specific subplots
Hi Lieke, Try this below: ax1 = subplot(8,1,1); % plot something ax2 = subplot(8,1,2); % plot something ax8 = subplot(8,1,...

18 dagen ago | 0

| accepted

Answered
swap values of an array
Hi Mazhar Ali, Try this below: for i = 1:numel(v) temp = O(v(i)); replacemnt = O(v(i)+1); O(v(i)) = r...

18 dagen ago | 0

Answered
Line property error with time series plot
Hi John, The below line is only gives the char array of a file name. You are not actually importing your data. Wind='FloNOAA...

18 dagen ago | 0

| accepted

Answered
Nested for loops and saving data in a vector
Hi, First start with preallocation. lambda will be your 100x7 matrix, each row is a set of 7 calculation. alpha=[-0.17445,0.0...

19 dagen ago | 1

| accepted

Answered
deleting the entire line starting from 0,0,0 from a huge text file
Try this: A(all((A(:,[1:3]) == [0 0 0])')',:) = []; Where A is the Nx6 double array from your text file.

19 dagen ago | 0

Answered
'Envelope' function doesn't work anymore
Maybe this would help you: restoredefaultpath rehash toolboxcache savepath Please restart Matlab after this execution.

19 dagen ago | 0

Answered
How to make an editable uitable with one categorical column ?
The reason is the uitable's 2nd and 3rd columns are cell array. You should create them as double arrays like below with bracke...

19 dagen ago | 0

| accepted

Answered
how to creat this vector Z?
Try this: X=[nan nan 4 3 6 9 2 nan nan nan 8 2 13 6 1 nan]; Y=[9 13]; risingEdgeLocs = find(diff(~isnan(X)) > 0); indSpli...

19 dagen ago | 1

| accepted

Answered
Automatic resize of tables in MATLAB
Have you tried java object written here? https://undocumentedmatlab.com/page/27 jScroll = findjobj(hTable); jTable = jScroll...

19 dagen ago | 0

Answered
How to dynamically name variables in a matlab struct?
You are almost there. Define your algor2 and probl2 as cell arrays with braces: algor2 = {'alg1','alg2','alg3'} probl2 = {'...

20 dagen ago | 0

| accepted

Answered
TickLabelFormat with exponential format without precision
just use logaritmic axis with semilogx: i = 1:10; x = 10.^i; y = rand(1,numel(x)); figure; hPlot = semilogx(x,y); Here i...

20 dagen ago | 0

Answered
Given feed back that, I need to call outputSummary with the proper arguments.
This code is so badly written. There are too many nested functions. outputSummary function is defined inside the costFunction....

20 dagen ago | 0

| accepted

Answered
Creating a n*2 array from a variable in workspace
Please read this below: https://www.mathworks.com/matlabcentral/answers/304528-tutorial-why-variables-should-not-be-named-dyna...

20 dagen ago | 0

Answered
Report or Research Paper which explains, How does fmincon work?
Here you can see another answer of the similar question: https://www.mathworks.com/matlabcentral/answers/111542-how-does-fminc...

20 dagen ago | 0

Answered
Multiplying a matrix in a cell by another matrix in the same cell
Try this: RU = {randi(20,25,1),randi(20,25,1),randi(20,25,1),randi(20,25,1),randi(20,25,1)}'; result = prod(horzcat(RU{1:nume...

21 dagen ago | 0

Answered
Help needed with a matlab code - end missing.
I haven't seen such a badly written code ever since in my life. How they put that in a paper? Zero comments, too many nested f...

21 dagen ago | 0

Answered
how can I show a photo by 10 seconds in matlab gui?
Try this: folderpath = 'C:\Users\...\Desktop\walpapers'; % folder of your jpg files directoryContent = dir([folderpath,'\*.jpg...

21 dagen ago | 0

| accepted

Load more