답변 있음
How to write this for loop as a while
Every for-loop can be re-written to a while-loop. y = 0; k = 1; while k<=999 y = y + k*k; k = k + 4; end

대략 5년 전 | 1

답변 있음
Modifying odd/even numbers of a column vector
If you have trouble with Matlab basics you may consider doing the Onramp tutorial (which is provided for free by Mathworks). x ...

대략 5년 전 | 0

| 수락됨

답변 있음
Multi Dimension Matrix Elements multiplication
Not completely without loops, but this should be fast enough. You should also be aware that loops can sometimes be the fastest w...

대략 5년 전 | 0

답변 있음
How to run function between each row
pairs=nchoosek(1:size(data,1),2); for n=1:size(pairs,1) row_a=data(pairs(n,1),:); row_b=data(pairs(n,2),:); %cal...

대략 5년 전 | 0

답변 있음
Single line plot with fixed axis
Every axes object has an XScale property you can set to 'log' to get the desired plot. You can use the normal plotting tools (e....

대략 5년 전 | 1

| 수락됨

답변 있음
How to click points in a figure to generate a function/set of data?
I would suggest getpts, although there is an alternative that gives visual feedback: ginput.

대략 5년 전 | 0

답변 있음
how to generate 10^6 random binary values consisting only -1 and 1?
doc randi

대략 5년 전 | 0

| 수락됨

답변 있음
matrix step shift in each row
This method works without a loop. A =[ 1 2 3 4 5 ]; [X,Y]=ndgrid(1:numel(A)); X=X(end:-1:1,:); ind=mod(...

대략 5년 전 | 0

| 수락됨

답변 있음
Nothing will be showing on plot
You are plotting single points, without changing the default (where points are not displayed, only the line connecting them). Yo...

대략 5년 전 | 0

답변 있음
How can I calculate the revenue in a FOR loop?
Store the revenue in a vector you index with s. Then use sum to calculate the total.

대략 5년 전 | 0

제출됨


GetWritableFolder
Return a folder with write permission.

대략 5년 전 | 다운로드 수: 1 |

0.0 / 5
Thumbnail

답변 있음
Form a Matrix dependent of iterations
I'm going to assume your question is a homework assignment. That is why I will ignore the requirement of using a while loop, as ...

대략 5년 전 | 0

답변 있음
how to save each array's results in dependent blank in GUI program base code?
For general advice and examples for how to create a GUI (and avoid using GUIDE), have look at this thread. Below I show you some...

대략 5년 전 | 0

| 수락됨

답변 있음
How to detect certain pixel value in a stick.
Something like this will do it: A=imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/524729/image.png'); ...

대략 5년 전 | 0

| 수락됨

답변 있음
Bar graph labels not aligning with index value
You need to set the location of the xticks as well, otherwise Matlab will use the current xticks and use your provided labels in...

대략 5년 전 | 0

답변 있음
Get Data from a 16414x6 array to 365 arrays with size(48x3)
I would suggest using a 3D array instead. If you dynamically generate variable names you are shooting yourself in the foot. You ...

대략 5년 전 | 1

답변 있음
zoom X axis only - app designer
Your app is a uifigure, so you can test this outside of AppDesigner. It turns out you need to be fairly specific with your handl...

대략 5년 전 | 0

답변 있음
plotting a graph error
What happens if you execute this? clc,type newplotwrapper I'm not sure I'm allowed to share the contents of this file, but it ...

대략 5년 전 | 0

답변 있음
How to solve "Matrix index is out of range for deletion." error?
Take a look at the indices on the second line: i=1; ind=(6*(i-1))+1:(6*(i-1))+6 Since you use them to index the columns (the ...

대략 5년 전 | 0

답변 있음
Can someone explain me how to make this loop efficiently?
Your intuition is correct; this can indeed be simplified: for k=1:numel(SomeArray) if idx <= (k*B) Array...

대략 5년 전 | 1

답변 있음
Saving a plot as png 224*224*3 image
You can do three things: Don't create your image as a plot, but as an image. Crop the image down to the location of your axes ...

대략 5년 전 | 0

답변 있음
While loop for testing the end of vector (Matlab)
You can use numel to create a loop over a vector of unknown size: A=rand(1,100); for n=1:numel(A) % n will go to 100 %you...

대략 5년 전 | 1

| 수락됨

답변 있음
best way to present data from histcounct
The cause of your problem is illustrated below: data=randi(5,100,1); BinEdges=linspace(0,6,14); [A,E] = histcounts(data,BinEd...

대략 5년 전 | 0

답변 있음
Compare rows of a column vector
Just like most functions like it, mode allows you to specify the dimension to operate on: A= [0, 0.4, 0.4;... 1, 1, ...

대략 5년 전 | 0

답변 있음
change resolution of DICOM
It looks like you want to interpolate a 3D image. As most image processing methods assume a 2D image, you might be better off lo...

대략 5년 전 | 0

답변 있음
Error in an algorithm for continued fractions
I suspect you are indeed running into rounding issues. Using an awful approach to unwind this continued fraction, I found this f...

대략 5년 전 | 1

| 수락됨

문제를 풀었습니다


Joining Ranges
You are given a n-by-2 matrix. Each row represents a numeric range, e.g. x = [0 5; 10 3; 20 15; 16 19; 25 25] contains...

대략 5년 전

문제를 풀었습니다


Remove the two elements next to NaN value
The aim is to *remove the two elements next to NaN values* inside a vector. For example: x = [6 10 5 8 9 NaN 23 9 7 3 21 ...

대략 5년 전

문제를 풀었습니다


Reindex a vector
You are given two vectors of equal length. Vector N has numeric values (no Inf or NaN) while vector IDX has integers. Place th...

대략 5년 전

문제를 풀었습니다


Fill a zeros matrix
The aim is to fill an array of all zeros given a numerical value and the index of row and columns for this value. 3 Inputs: ...

대략 5년 전

더 보기